Unexpected primitive based Enum (de)serialization #51016
Labels
area:core
area:serialization
kind:bug
This is a clearly a bug
needs-triage
label for new issues that we didn't triage yet
Apache Airflow version
main (development)
If "Other Airflow 2 version" selected, which one?
No response
What happened?
When enumeration inherits some primitive type (e.g. str, int), deserialization makes the value primitive as well.
What you think should happen instead?
This is little unexpected for me as a user and for mypy
The other issue is that if I add airflow compatible custom serialization the result is incorrect too
I would expect one of
TypeError: cannot serialize object of type <enumeration 'MyEnum'>
unless it implements the interface and is registered for deserialization (as it happens for enums that do not inherit primitive)How to reproduce
See the snippet above
Operating System
Debian GNU/Linux 12 (bookworm)
Versions of Apache Airflow Providers
No response
Deployment
Virtualenv installation
Deployment details
No response
Anything else?
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: