Skip to content

Fix import of pydantic #196

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

Merged
merged 1 commit into from
Nov 9, 2023
Merged

Fix import of pydantic #196

merged 1 commit into from
Nov 9, 2023

Conversation

mattt
Copy link
Contributor

@mattt mattt commented Nov 9, 2023

Resolves #195

Pydantic 2 introduced some breaking changes, but we work around that by attempting to import its v1 compatibility shim (#121):

try:
    from pydantic import v1 as pydantic
except ImportError:
    import pydantic

However, we had pass instead of import pydantic in a few places, which caused pydantic imports to fail for anyone using pydantic 1.

Signed-off-by: Mattt Zmuda <[email protected]>
@mattt mattt merged commit 865d491 into main Nov 9, 2023
@mattt mattt deleted the mattt/fix-pydantic-import branch November 9, 2023 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NameError: name 'pydantic' is not defined
1 participant