Skip to content

Conversation

@lpeppe
Copy link
Contributor

@lpeppe lpeppe commented Jan 30, 2026

The goal of this PR is to allow Avrogen-generated modules to be backwards compatible.

The problem with the current implementation is that, if a schema is evolved in a backwards-compatible way (e.g. a new nullable field is added), the from_avro_map/1 function generated from the new schema won't be able to decode payloads encoded with the old version of the schema. This happens because old payloads won't have the new nullable field, but from_avro_map/1 is pattern matching all the map fields.

With this PR, nullable fields are not matched in the function signature. This way, newer versions of modules can read payloads encoded with older versions.

@lpeppe lpeppe requested a review from a team as a code owner January 30, 2026 15:15
Copy link

@emiliano-at-prima emiliano-at-prima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the pr looks very good to me ❤️, if you need to release a new version quickly add a suite-py bump commit with a new minor

@emiliano-at-prima emiliano-at-prima merged commit 4f3c043 into master Feb 2, 2026
10 checks passed
@emiliano-at-prima emiliano-at-prima deleted the support-backwards-compatibility-in-from-map branch February 2, 2026 10:55
@emiliano-at-prima
Copy link

released with 0.11.0

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.

2 participants