Fix Encryption fails when expanded union types have two references to the same record (#2262)#2263
Conversation
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes an issue where encryption fails when expanded union types contain two references to the same record. Adds a _collapse_schema helper that re-collapses already-expanded named type references before validation in _resolve_union.
Changes:
- Add
_collapse_schemafunction to collapse expanded named-type references back to name references before validating union members. - Use
_collapse_schemaon a deep copy of the subschema in_resolve_unionprior tovalidate(). - Add sync and async tests covering union with two references to the same record type, plus a CHANGELOG entry.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| src/confluent_kafka/schema_registry/common/avro.py | Adds _collapse_schema helper and uses it during union resolution validation. |
| tests/schema_registry/_sync/test_avro_serdes.py | Adds sync test for encryption with union containing repeated record refs. |
| tests/schema_registry/_async/test_avro_serdes.py | Adds async equivalent test. |
| CHANGELOG.md | Documents the fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/sem-approve |
|
ChristophMajcenAtXxxlutz , please run |
e2772a8 to
af67577
Compare
|
Robert Yokota (@rayokota) Fixed the styling issues |
|
/sem-approve |
|
ChristophMajcenAtXxxlutz , looks like there's a mypy error now:
|
|
/sem-approve |
Robert Yokota (rayokota)
left a comment
There was a problem hiding this comment.
Thanks ChristophMajcenAtXxxlutz , LGTM
What
Fix Encryption fails when expanded union types have two references to the same record
Checklist
References
Github: #2262
Test & Review
Automatic tests