marcosschroh / dataclasses-avroschema

Generate avro schemas from python classes. Code generation from avro schemas. Serialize/Deserialize python instances with avro schemas
https://marcosschroh.github.io/dataclasses-avroschema/
MIT License
213 stars 64 forks source link

fix: Always reuse the rendered type when type is same #710

Closed sanjayjayaramu-cruise closed 1 month ago

sanjayjayaramu-cruise commented 1 month ago

During avro_schema_to_python() call if two fields in different child fields of a class has same type and name, reuse the rendered field in the schema instead of re-rendering.

Fixes https://github.com/marcosschroh/dataclasses-avroschema/issues/709

Testing

Added a new round trip test with the nested fields in schema.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.48%. Comparing base (40ef9e3) to head (c944477).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #710 +/- ## ======================================= Coverage 99.48% 99.48% ======================================= Files 34 34 Lines 1944 1944 ======================================= Hits 1934 1934 Misses 10 10 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

marcosschroh commented 1 month ago

Awesome @sanjayjayaramu-cruise !