Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

field_order attribute causes weird behavior #786

Open
DavidMcGurkTNG opened this issue Oct 31, 2024 · 0 comments
Open

field_order attribute causes weird behavior #786

DavidMcGurkTNG opened this issue Oct 31, 2024 · 0 comments

Comments

@DavidMcGurkTNG
Copy link

Describe the bug
When trying to define field_order for classes which inherit from AvroBaseModel, this can cause some weird side-effects. Field order seems to work like a private attribute, since it is created when running .avro_schema(), and this field_order created by running this method overwrites the field_order which is explicitly defined. This can also have the effect that if one pytest checks that each schema inheriting from AvroBaseModel has a complete (user defined) field order, and then a subsequent test checks that .avro_schema() successfully generates the schema, then these tests will catch the error if run in this order, but not if run in a different order.

It was also found that on >= 0.63.2, sometimes editing the field order of a child class could affect the field order of instances of the parent class.

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

No branches or pull requests

1 participant