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

Conditional imports to support operating with pydantic>2 installed #60

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion prefect_airbyte/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@
from prefect import get_run_logger, task
from prefect.blocks.abstract import JobBlock, JobRun
from prefect.utilities.asyncutils import sync_compatible
from pydantic import BaseModel, Field
from pydantic import VERSION as PYDANTIC_VERSION

if PYDANTIC_VERSION.startswith("2."):
from pydantic.v1 import BaseModel, Field
else:
from pydantic import BaseModel, Field

from typing_extensions import Literal

from prefect_airbyte import exceptions as err
Expand Down
7 changes: 6 additions & 1 deletion prefect_airbyte/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
from logging import Logger

from prefect.blocks.core import Block
from pydantic import Field, SecretStr
from pydantic import VERSION as PYDANTIC_VERSION

if PYDANTIC_VERSION.startswith("2."):
from pydantic.v1 import Field, SecretStr
else:
from pydantic import Field, SecretStr

from prefect_airbyte.client import AirbyteClient

Expand Down