Skip to content

Adding extra field via setattr adds field to model_extra#6365

Merged
adriangb merged 3 commits intopydantic:mainfrom
aaraney:fix-6333
Jul 2, 2023
Merged

Adding extra field via setattr adds field to model_extra#6365
adriangb merged 3 commits intopydantic:mainfrom
aaraney:fix-6333

Conversation

@aaraney
Copy link
Copy Markdown
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
@adriangb
Copy link
Copy Markdown
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