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

Allow None when using a Union containing Any or object #3452

Merged
merged 6 commits into from Dec 10, 2021

Conversation

tharradine
Copy link
Contributor

Change Summary

This sets allow_none and required correctly when Any or Object are contained in a Union type.

Related issue number

Resolves #3444.

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100%
  • Documentation reflects the changes where applicable
  • changes/3444-tharradine.md file added describing change
    (see changes/README.md for details)
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

@tharradine
Copy link
Contributor Author

Please review :)

Copy link
Member

@PrettyWood PrettyWood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise! Thanks

pydantic/fields.py Outdated Show resolved Hide resolved
@PrettyWood
Copy link
Member

please update

@tharradine
Copy link
Contributor Author

please review

I accidentally commented in my personal account before, sorry for the spam!

@samuelcolvin samuelcolvin merged commit 6ad80cd into pydantic:master Dec 10, 2021
@samuelcolvin
Copy link
Member

thanks so much.

@tharradine tharradine deleted the GH-3444 branch September 29, 2022 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"none is not an allowed value" when using Union with Any
3 participants