anishgirianish commented on code in PR #61937:
URL: https://github.com/apache/airflow/pull/61937#discussion_r2882129909


##########
airflow-core/tests/unit/serialization/test_serialized_objects.py:
##########
@@ -834,6 +834,44 @@ def test_decode_partition_mapper_not_exists():
         decode_partition_mapper({Encoding.TYPE: "not_exists", Encoding.VAR: 
{}})
 
 
+def test_encode_product_mapper():
+    from airflow.sdk import IdentityMapper, ProductMapper
+    from airflow.serialization.encoders import encode_partition_mapper
+
+    partition_mapper = ProductMapper([IdentityMapper(), IdentityMapper()])
+    assert encode_partition_mapper(partition_mapper) == {
+        Encoding.TYPE: "airflow.partition_mappers.product.ProductMapper",
+        Encoding.VAR: {
+            "mappers": [
+                {
+                    Encoding.TYPE: 
"airflow.partition_mappers.identity.IdentityMapper",
+                    Encoding.VAR: {},
+                },
+                {
+                    Encoding.TYPE: 
"airflow.partition_mappers.identity.IdentityMapper",
+                    Encoding.VAR: {},
+                },
+            ]
+        },
+    }
+
+
+def test_decode_product_mapper():
+    from airflow.partition_mappers.product import ProductMapper as 
CoreProductMapper
+    from airflow.sdk import IdentityMapper, ProductMapper
+    from airflow.serialization.decoders import decode_partition_mapper
+    from airflow.serialization.encoders import encode_partition_mapper
+
+    partition_mapper = ProductMapper([IdentityMapper(), IdentityMapper()])

Review Comment:
    Done, switched to HourlyMapper + DailyMapper.



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