mykola-shyshov commented on issue #57726:
URL: https://github.com/apache/airflow/issues/57726#issuecomment-3506719890
Documentation says (implemented as in public doc): serializers ->
serialize() method -> @dataclass or @attr.define
> Airflow out of the box supports three ways of custom serialization.
Primitives are returned as is, without additional encoding, e.g. a str remains
a str. When it is not a primitive (or iterable thereof) Airflow looks for a
registered serializer and deserializer in the namespace of
airflow.serialization.serializers. If not found it will look in the class for a
serialize() method or in case of deserialization a deserialize(data, version:
int) method. Finally, if the class is either decorated with @dataclass or
@attr.define it will use the public methods for those decorators.
Code docs: serialize() method -> serializers -> @dataclass or @attr.define
> Values that are not of a built-in type are serialized if a serializer is
found for them. The order in which serializers are used is
1. A ``serialize`` function provided by the object.
2. A registered serializer in the namespace of
``airflow.serialization.serializers``
3. Annotations from attr or dataclass.
As for me, it would be nice to have a way to override any serialization
logic by custom user serializers. That’s probably what I would expect. I think
there were reasons to do so.
--
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]