Skip to content

Commit

Permalink
fix: put custom serializer block after builtin serializers
Browse files Browse the repository at this point in the history
  • Loading branch information
joffreybienvenu-infrabel committed Feb 9, 2024
1 parent 3f752be commit 7e3f622
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions airflow/serialization/serde.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,18 @@ def serialize(o: object, depth: int = 0) -> U | None:
qn = "builtins.tuple"
classname = qn

# custom serializers
dct = {
CLASSNAME: qn,
VERSION: getattr(cls, "__version__", DEFAULT_VERSION),
}

# if there is a builtin serializer available use that
if qn in _serializers:
data, serialized_classname, version, is_serialized = _serializers[qn].serialize(o)
if is_serialized:
return encode(classname or serialized_classname, version, serialize(data, depth + 1))

# custom serializers
dct = {
CLASSNAME: qn,
VERSION: getattr(cls, "__version__", DEFAULT_VERSION),
}

# object / class brings their own
if hasattr(o, "serialize"):
data = getattr(o, "serialize")()
Expand Down

0 comments on commit 7e3f622

Please sign in to comment.