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

Correct docs, logic for model_construct behavior with extra #8807

Merged
merged 3 commits into from Feb 14, 2024

Conversation

sydney-runkle
Copy link
Member

@sydney-runkle sydney-runkle commented Feb 13, 2024

Fix #8266

  1. Correct + expand on docs re model_construct behavior based on a model's extra setting
  2. Correct behavior in the case of model_config.extra == 'ignore'

Selected Reviewer: @adriangb

@sydney-runkle sydney-runkle added the relnotes-change Used for changes to existing functionality which don't have a better categorization. label Feb 13, 2024
Copy link

cloudflare-pages bot commented Feb 13, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: b195e7d
Status: ✅  Deploy successful!
Preview URL: https://ad0bef4f.pydantic-docs2.pages.dev
Branch Preview URL: https://fix-model-construct-doc.pydantic-docs2.pages.dev

View logs

Copy link

codspeed-hq bot commented Feb 13, 2024

CodSpeed Performance Report

Merging #8807 will not alter performance

Comparing fix-model-construct-doc (b195e7d) with main (071c2c8)

Summary

✅ 10 untouched benchmarks

@sydney-runkle
Copy link
Member Author

Please review

Copy link
Member

@adriangb adriangb left a comment

Choose a reason for hiding this comment

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

This makes sense, but like you say it is technically a breaking change. Is there a strong justification to make this change?

docs/concepts/models.md Show resolved Hide resolved
@sydney-runkle
Copy link
Member Author

This makes sense, but like you say it is technically a breaking change. Is there a strong justification to make this change?

I think it's a minor enough breaking change that we can include it in a minor release, and I'd rather have strong documentation + correct behavior sooner rather than later. The sooner we fix this, the fewer people a change would impact down the line. But other than one person reporting the inconsistency in the docs / behavior, there's no strong justification.

@adriangb
Copy link
Member

I think the fact that the runtime behavior is different than the documented behavior is a good start to justify the change.

@sydney-runkle sydney-runkle merged commit e99bf8a into main Feb 14, 2024
55 checks passed
@sydney-runkle sydney-runkle deleted the fix-model-construct-doc branch February 14, 2024 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review relnotes-change Used for changes to existing functionality which don't have a better categorization.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected inconsistent behaviour when using 'model_construct'
2 participants