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

fix: properly set annotation in union with Annotated constraints in subtypes #355

Merged
merged 1 commit into from
Sep 12, 2023

Conversation

guacs
Copy link
Member

@guacs guacs commented Sep 11, 2023

Pull Request Checklist

  • New code has 100% test coverage
  • (If applicable) The prose documentation has been updated to reflect the changes introduced by this PR
  • (If applicable) The reference documentation has been updated to reflect the changes introduced by this PR
  • Pre-Commit Checks were ran and passed
  • Tests were ran and passed

Description

  • This PR ensures the constraints are properly parsed when using an optional with Annotated constraints in subtypes.

Close Issue(s)

@guacs guacs requested review from a team as code owners September 11, 2023 16:08
@guacs guacs force-pushed the pydantic-optional-constraints branch from ce3a841 to f58aeb5 Compare September 11, 2023 16:09
@guacs guacs force-pushed the pydantic-optional-constraints branch from f58aeb5 to 398e966 Compare September 11, 2023 16:13
@sonarcloud
Copy link

sonarcloud bot commented Sep 11, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@guacs guacs merged commit f639c26 into main Sep 12, 2023
17 checks passed
@guacs guacs deleted the pydantic-optional-constraints branch September 12, 2023 02:39
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.

Bug: constraints not working in pydantic v2 (when a Union is used)
2 participants