jpmorganchase / py-avro-schema

Generate Apache Avro schemas for Python types including standard library data-classes and Pydantic data models.
https://py-avro-schema.readthedocs.io/
Apache License 2.0
37 stars 6 forks source link

feat: add support for union #56

Closed cgtobi closed 1 year ago

cgtobi commented 1 year ago

Add support for modern Union and Optional syntax to successfully generate achema.

str | int => ["string", "long"]
str | None => ["string", "null"]
faph commented 1 year ago

Thanks! Let me review on Monday

cgtobi commented 1 year ago

@faph Great. Thanks!

faph commented 1 year ago

Would you mind also updating the relevant documentation section? https://py-avro-schema.readthedocs.io/en/stable/types.html#typing-union

faph commented 1 year ago

I am afraid I have to ask this, would you mind completing the CLA @cgtobi if you have not done so yet?

See https://github.com/jpmorganchase/.github/blob/main/CONTRIBUTING.md and https://github.com/jpmorganchase/.github/blob/main/jpmc-cla-20230406.md

cgtobi commented 1 year ago

Thanks @faph for your feedback. Let me know if you find the comment sufficient. I also sent the CLA you way.

faph commented 1 year ago

I am just fixing RST formatting, will merge after.

Many thanks for this!

faph commented 1 year ago

Released as version 3.2.0

cgtobi commented 1 year ago

Thanks to you for publishing and maintaining this lib in the first place. And for making contribution a joy.