Skip to content

[bug] Unable to import DetectPII from guardrails.hub #1305

@sl2902

Description

@sl2902

I installed guardrails version 0.6.6 and ran guardrails configure. I then installed the package
from the hub guardrails hub install hub://guardrails/detect_pii; the following version 0.0.5 was installed successfully.
However, when I import from guardrails.hub import DetectPII, I encounter the error

     13 # Official Guardrails Hub imports
---> 14 from guardrails.hub import DetectPII, ToxicLanguage
     15 from guardrails import Guard
     16 

ImportError: cannot import name 'DetectPII' from 'guardrails.hub' (/usr/local/lib/python3.11/dist-packages/guardrails/hub/__init__.py)

On inspecting the file, the installation produces the following top level import
from guardrails_grhub_detect_pii import DetectPII
I was able to import the relevant module using the above import statement. Is this an issue with registering the validator?

The version of Python that I am running on is 3.11.13. I tested this on Jupyter Colab

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions