bolkedebruin commented on issue #51016: URL: https://github.com/apache/airflow/issues/51016#issuecomment-2934336473
I think that is a bit too simple. We serialize builtin types first for a reason, speed of course but also consistency: I don't think we want people to overwrite the serializer for a primitive. Here, It is slightly confusing that Enums are instances of Enums but also of a primitive. Furthermore, there is the additional challenge is that the qualified name of an Enum can be anything (`MyEnum(Enum)`) and its values can be composites of anything. That can cause security challenges. I think the code here should "break" when encountering and Enum and the Enum serializer should only serialize "IntEnum, StrEnum and IntFlag" (fully qualified). The deserializer should have IntEnum, StrEnum, IntFlag added to its extra_allowed list. https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/serialization/serde.py#L123-L124 so ``` if isinstance(o, enum.Enum): break ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
