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

Adding extra field via setattr adds field to model_extra #6365

Merged
merged 3 commits into from Jul 2, 2023

Conversation

aaraney
Copy link
Contributor

@aaraney aaraney commented Jul 2, 2023

Change Summary

If extra fields are allowed and set via setattr, they are now added to model_extra (i.e. __pydantic_extra__).

Related issue number

fix #6333

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100%
  • Documentation reflects the changes where applicable
  • changes/<pull request or issue id>-<github username>.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

@adriangb adriangb merged commit 1d0f405 into pydantic:main Jul 2, 2023
49 checks passed
@adriangb
Copy link
Member

adriangb commented Jul 2, 2023

Thanks @aaraney!

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.

setattr does not add extra field to model_extra (i.e. __pydantic_extra__)
2 participants