Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQLCredentials block does not have a validator #11

Closed
jmbhughes opened this issue Oct 16, 2023 · 2 comments
Closed

MySQLCredentials block does not have a validator #11

jmbhughes opened this issue Oct 16, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@jmbhughes
Copy link
Member

The CI has failed on a Prefect/pydantic error about the MySQLCredentials block not having a validator.

_______ ERROR collecting punchpipe/controlsegment/tests/test_launcher.py _______
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/runner.py:341: in from_call
    result: Optional[TResult] = func()
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/runner.py:372: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/python.py:531: in collect
    self._inject_setup_module_fixture()
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/python.py:545: in _inject_setup_module_fixture
    self.obj, ("setUpModule", "setup_module")
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/python.py:310: in obj
    self._obj = obj = self._getobj()
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/python.py:528: in _getobj
    return self._importtestmodule()
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/python.py:617: in _importtestmodule
    mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/pathlib.py:567: in import_path
    importlib.import_module(module_name)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:992: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:992: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:883: in exec_module
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
punchpipe/controlsegment/__init__.py:9: in <module>
    from punchpipe.controlsegment.db import Base, Flow, File
punchpipe/controlsegment/db.py:10: in <module>
    class MySQLCredentials(Block):
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pydantic/v1/main.py:197: in __new__
    fields[ann_name] = ModelField.infer(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pydantic/v1/fields.py:506: in infer
    return cls(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pydantic/v1/fields.py:436: in __init__
    self.prepare()
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pydantic/v1/fields.py:557: in prepare
    self.populate_validators()
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pydantic/v1/fields.py:831: in populate_validators
    *(get_validators() if get_validators else list(find_validators(self.type_, self.model_config))),
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pydantic/v1/validators.py:765: in find_validators
    raise RuntimeError(f'no validator found for {type_}, see `arbitrary_types_allowed` in Config')
E   RuntimeError: no validator found for <class 'pydantic.types.SecretStr'>, see `arbitrary_types_allowed` in Config
@jmbhughes jmbhughes added the bug Something isn't working label Oct 16, 2023
@jmbhughes jmbhughes self-assigned this Oct 16, 2023
@jmbhughes
Copy link
Member Author

I can recreate this error locally if I update pydantic in my dev environment.

jmbhughes added a commit that referenced this issue Oct 16, 2023
@jmbhughes
Copy link
Member Author

Will be resolved by #12

jmbhughes added a commit that referenced this issue Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant