Lee-W commented on code in PR #60204:
URL: https://github.com/apache/airflow/pull/60204#discussion_r2693857035
##########
airflow-core/src/airflow/serialization/encoders.py:
##########
@@ -347,3 +364,41 @@ def ensure_serialized_asset(obj: BaseAsset |
SerializedAssetBase) -> SerializedA
from airflow.serialization.decoders import decode_asset_like
return decode_asset_like(encode_asset_like(obj))
+
+
+class _PartitionMapperSerializer:
+ BUILTIN_PARTITION_MAPPERS: dict[type, str] = {
+ IdentityMapper: "airflow.timetables.simple.IdentityMapper",
+ }
+
+ @functools.singledispatchmethod
+ def serialize(self, partition_mapper: PartitionMapper) -> dict[str, Any]:
+ raise NotImplementedError
+
+ @serialize.register
+ def _(self, partition_mapper: IdentityMapper) -> dict[str, Any]:
+ return {}
Review Comment:
I renamed it as `_Serializer` and split `serialize` into
`serialize_timetable` and `serialize_partition_mapper`. I think it would be
easier to maintain this way
--
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]