Skip to content

Add validation warning for unrecognized chart fields - #435

Merged
palewire merged 2 commits into
chekos:mainfrom
palewire:main
Oct 18, 2025
Merged

Add validation warning for unrecognized chart fields#435
palewire merged 2 commits into
chekos:mainfrom
palewire:main

Conversation

@palewire

Copy link
Copy Markdown
Collaborator

No description provided.

Add a model validator to BaseChart that warns users when they pass unrecognized field names that don't match the model's defined fields or aliases. This helps catch typos and API misunderstandings without breaking initialization.

The validator:
- Checks incoming data against valid field names and their aliases
- Ignores private attributes (starting with "_")
- Issues UserWarning with helpful message listing unrecognized fields
- Returns data unchanged to allow initialization to proceed

This improves developer experience by providing early feedback on potential mistakes while maintaining backward compatibility.
@palewire
palewire merged commit 9fcc8d1 into chekos:main Oct 18, 2025
9 checks passed
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.

1 participant