Raise ArgumentTypeError for non-string variant choices - #131
Raise ArgumentTypeError for non-string variant choices#131sapunyangkut wants to merge 2 commits into
Conversation
Validate variant tags before alias lookup or spelling suggestions so invalid list, mapping, numeric, and null values raise ArgumentTypeError instead of raw TypeError. AI-assisted by OpenAI Codex; submitted as a Draft for maintainer review.
for more information, see https://pre-commit.ci
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughVariant choice handling now rejects non-string discriminator values with structured type errors, includes aliases in expected-choice suggestions, preserves alias normalization, and adds tests for invalid types, aliases, and misspelled tags. ChangesVariant choice validation
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #131 +/- ##
==========================================
+ Coverage 75.14% 75.23% +0.08%
==========================================
Files 9 9
Lines 853 856 +3
==========================================
+ Hits 641 644 +3
Misses 212 212 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
ArgumentTypeErrorfor list, mapping, numeric, and null tags instead of leaking rawTypeErrorDid you meanbehavior for string valuesFixes #119.
Validation
git diff --check, Python AST checks, and a bounded manual security review passed in the publication worktreetypeguardis not installed; no dependencies were installed for this submissionAI assistance disclosure
This change was prepared and tested with OpenAI Codex. It is intentionally opened as a Draft for maintainer review. No automated issue/PR comments or Ready transition will be made.
Summary by CodeRabbit
Bug Fixes
Tests