hchasestevens / avro2py

Avro codegen for Python 3.6+
MIT License
4 stars 2 forks source link

supported collisions between modules and packages in emitted code #5

Closed drobert closed 3 years ago

drobert commented 3 years ago

Consider namespace what we have is com.example.foo with schemas defined at the both level com.example and com.example.foo This causes a problem in import. For example, from mymodule.com import example imports the sub-package example instead of the module example.py The schema defined at the foo level uses a schema defined at example level. Even though the codegen is succesfull, it gives error in importing the generated classes. For example from mymodule.com.example import foo gives ImportError: cannot import name 'MyFooRecord' from 'mymodule.com.example'