uranusjr commented on code in PR #60204:
URL: https://github.com/apache/airflow/pull/60204#discussion_r2689853782


##########
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:
   If we want to build this for future-proof when custom partition mapper 
classes, maybe _TimetableSerializer can be renamed to also handle this? These 
singledispatchmethods are all independent; they can live on the same class.



-- 
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]

Reply via email to