You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use prefect-airbyte with Prefect 3 and continue to run into issues with the Pydantic version. It seems like this package is maybe no longer being maintained, but posting here in the off chance someone has a solution. Here is the error I am receiving:
Traceback (most recent call last):
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/xyz-prefect/.venv/lib/python3.11/site-packages/prefect_airbyte/init.py", line 3, in
from prefect_airbyte.connections import AirbyteConnection # noqa F401
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/prefect_airbyte/connections.py", line 21, in
from prefect_airbyte.server import AirbyteServer
File "/xyz-prefect/.venv/lib/python3.11/site-packages/prefect_airbyte/server.py", line 16, in
class AirbyteServer(Block):
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_model_construction.py", line 224, in new
complete_model_class(
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_model_construction.py", line 577, in complete_model_class
schema = cls.get_pydantic_core_schema(cls, handler)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/main.py", line 671, in get_pydantic_core_schema
return handler(source)
^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in call
schema = self._handler(source_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
schema = self._generate_schema_inner(obj)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 924, in _generate_schema_inner
return self._model_schema(obj)
^^^^^^^^^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 739, in _model_schema
{k: self._generate_md_field_schema(k, v, decorators) for k, v in fields.items()},
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 739, in
{k: self._generate_md_field_schema(k, v, decorators) for k, v in fields.items()},
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1115, in _generate_md_field_schema
common_field = self._common_field_schema(name, field_info, decorators)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1308, in _common_field_schema
schema = self._apply_annotations(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2107, in _apply_annotations
schema = get_inner_schema(source_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in call
schema = self._handler(source_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2091, in inner_handler
metadata_js_function = _extract_get_pydantic_json_schema(obj, schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2447, in _extract_get_pydantic_json_schema
raise PydanticUserError(
pydantic.errors.PydanticUserError: The __modify_schema__ method is not supported in Pydantic v2. Use __get_pydantic_json_schema__ instead in class SecretStr.
hi @padioca - sorry, it looks like we forgot to update the readme here.
this collection is no longer maintained by Prefect and was not migrated to prefect 3.x (where notably, prefect 3.x uses pydantic 2 instead of using pydantic 1 like prefect 2.x did)
I will make sure this is updated so this is clear, sorry again about the confusion. in the meantime I would encourage you to:
yank any logic you find useful from this library and use it directly or fork this
I will say that I originally wrote this before airbyte released their cloud api, so the logic itself is likely outdated.
I am trying to use prefect-airbyte with Prefect 3 and continue to run into issues with the Pydantic version. It seems like this package is maybe no longer being maintained, but posting here in the off chance someone has a solution. Here is the error I am receiving:
Traceback (most recent call last):
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/xyz-prefect/.venv/lib/python3.11/site-packages/prefect_airbyte/init.py", line 3, in
from prefect_airbyte.connections import AirbyteConnection # noqa F401
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/prefect_airbyte/connections.py", line 21, in
from prefect_airbyte.server import AirbyteServer
File "/xyz-prefect/.venv/lib/python3.11/site-packages/prefect_airbyte/server.py", line 16, in
class AirbyteServer(Block):
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_model_construction.py", line 224, in new
complete_model_class(
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_model_construction.py", line 577, in complete_model_class
schema = cls.get_pydantic_core_schema(cls, handler)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/main.py", line 671, in get_pydantic_core_schema
return handler(source)
^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in call
schema = self._handler(source_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
schema = self._generate_schema_inner(obj)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 924, in _generate_schema_inner
return self._model_schema(obj)
^^^^^^^^^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 739, in _model_schema
{k: self._generate_md_field_schema(k, v, decorators) for k, v in fields.items()},
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 739, in
{k: self._generate_md_field_schema(k, v, decorators) for k, v in fields.items()},
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1115, in _generate_md_field_schema
common_field = self._common_field_schema(name, field_info, decorators)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1308, in _common_field_schema
schema = self._apply_annotations(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2107, in _apply_annotations
schema = get_inner_schema(source_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in call
schema = self._handler(source_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2091, in inner_handler
metadata_js_function = _extract_get_pydantic_json_schema(obj, schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/xyz-prefect/.venv/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2447, in _extract_get_pydantic_json_schema
raise PydanticUserError(
pydantic.errors.PydanticUserError: The
__modify_schema__
method is not supported in Pydantic v2. Use__get_pydantic_json_schema__
instead in classSecretStr
.For further information visit https://errors.pydantic.dev/2.9/u/custom-json-schema
The text was updated successfully, but these errors were encountered: