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

feat: use Pydantic V2 models when possible instead of defaulting to Pydantic V1 models #222

Open
wants to merge 40 commits into
base: development
Choose a base branch
from

Conversation

adubovik
Copy link
Collaborator

@adubovik adubovik commented Feb 25, 2025

Resolves #220

Currently, DIAL SDK produces the Pydantic v1 models even when Pydantic v2 is installed:

Pydantic installed DIAL SDK models
v1 v1
v2 v1

The fix introduces PYDANTIC_V2 environment variable to control the version of Pydantic models used when Pydantic v2 is installed.

So when PYDANTIC_V2=True:

Pydantic installed DIAL SDK models
v1 v1
v2 v2

By default, PYDANTIC_V2 is set to False to maintain backward compatibility.

@adubovik adubovik self-assigned this Feb 25, 2025
@adubovik adubovik force-pushed the feat/compatibility-with-pydantic-v2 branch from feb1b25 to e5e3f25 Compare February 25, 2025 13:31
@adubovik adubovik force-pushed the feat/compatibility-with-pydantic-v2 branch from 6295e9b to 73d77ac Compare March 5, 2025 12:11
@adubovik adubovik force-pushed the feat/compatibility-with-pydantic-v2 branch from 12df9f3 to 03d6106 Compare March 5, 2025 16:07
@adubovik adubovik marked this pull request as ready for review March 6, 2025 12:59
@adubovik adubovik requested a review from vladisavvv as a code owner March 6, 2025 12:59
@adubovik adubovik force-pushed the feat/compatibility-with-pydantic-v2 branch from fd4ee29 to 69637d2 Compare March 24, 2025 16:29
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.

Support compatibility with Pydantic V2
1 participant