Fix from_chemeleon=True throwing error#544
Merged
Merged
Conversation
Move backwards-compatibility logic for from_chemeleon → from_foundation from __init__ into a @model_validator(mode='before') classmethod, which is the idiomatic Pydantic v2 pattern for pre-processing input data before fields are assigned. - Add handle_from_chemeleon_compat pre-validator that emits a DeprecationWarning and translates from_chemeleon=True to from_foundation='chemeleon' before field assignment - Remove compat if-blocks from __init__, which now only tracks _explicit_init_fields - Mark from_chemeleon as deprecated in the docstring - Add test for happy-path compat (from_chemeleon=True → from_foundation) - Add test asserting DeprecationWarning is emitted Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix error where if you just set from_chemeleon=True, you hit error.
Quality Assurance & AI Policy
To maintain project quality and respect maintainer bandwidth, please confirm the following:
Status
Developers Certificate of Origin
Note to Contributors: We reserve the right to close PRs without review if they appear to lack human validation or do not meet the quality standards described in our
CONTRIBUTING.md.