Fix redefining a named Avro type in a diamond dependency pattern#2238
Fix redefining a named Avro type in a diamond dependency pattern#2238Robert Yokota (rayokota) wants to merge 2 commits intomasterfrom
Conversation
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
There was a problem hiding this comment.
Pull request overview
Fixes Avro schema reference resolution for “diamond dependency” graphs where multiple sibling references share the same named type, avoiding SchemaParseException("redefined named type ...") during parsing.
Changes:
- Update
_resolve_named_schema(sync + async) to store referenced schemas in raw (unparsed) form so the top-levelload_schemaresolves each named type only once. - Add sync and async regression tests that reproduce the diamond-dependency reference pattern and verify serialize/deserialize round-trips.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/confluent_kafka/schema_registry/_sync/avro.py |
Adjusts named-schema reference collection to prevent duplicate inline definitions in diamond graphs. |
src/confluent_kafka/schema_registry/_async/avro.py |
Async equivalent of the named-schema reference resolution fix. |
tests/schema_registry/_sync/test_avro_serdes.py |
Adds regression test covering diamond reference dependencies for sync serializer/deserializer. |
tests/schema_registry/_async/test_avro_serdes.py |
Adds regression test covering diamond reference dependencies for async serializer/deserializer. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|




What
Fix redefining a named Avro type in a diamond dependency pattern. Fixes #2236
Checklist
References
JIRA:
Test & Review
Open questions / Follow-ups