fix(storage): preserve allowed Pydantic extras in snapshots 🤖🤖🤖 - #280
fix(storage): preserve allowed Pydantic extras in snapshots 🤖🤖🤖#280Sampoornnagpal wants to merge 2 commits into
Conversation
Signed-off-by: Sampoorn Nagpal <nagpalsampoorn@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 12 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughPydantic serialization now includes eligible ChangesSerialization extras
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to Snapshot restoration now preserves allowed Pydantic extra fields while retaining filtering and lenient schema-drift behavior. No merge-blocking risk is currently identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Signed-off-by: Sampoorn Nagpal <nagpalsampoorn@gmail.com>
What does this PR do?
Snapshots silently drop allowed Pydantic extras. For example, a
ModelConfigwithnum_retries=7restores without that supported provider setting. Serializemodel_extravalues recursively and retain them during restoration when the model declaresextra="allow".Nested extras use the existing typed envelopes, class allowlist, and
nosnapshothandling. Models that ignore or forbid extras keep the existing lenient restoration behavior for schema drift.Validation
The four new cases fail before the fix.
uv run pytest -q tests/storage— 101 passed, including existing strict-model and allowlist tests.Windows/Python 3.12 with external import-only helpers for the existing
fcntl/SIGUSR2blockers (#84/#85). Helpers are not included and do not validate locks/signals. No live provider calls.Related issues
No matching open issue found.
Checklist
Summary by CodeRabbit