phanikumv commented on code in PR #66848:
URL: https://github.com/apache/airflow/pull/66848#discussion_r3385697319


##########
airflow-core/src/airflow/partition_mappers/base.py:
##########
@@ -139,20 +152,34 @@ def to_upstream(self, downstream_key: str) -> 
frozenset[str]:
         )
 
     def serialize(self) -> dict[str, Any]:
-        from airflow.serialization.encoders import encode_partition_mapper, 
encode_window
+        # Builtin RollupMappers serialize through ``encode_partition_mapper``
+        # (encoders.py), not this method. Keep the two in sync: a new field 
must
+        # be added there (and to ``encode_wait_policy``) too, or it is silently
+        # dropped for builtin instances.
+        from airflow.serialization.encoders import (
+            encode_partition_mapper,
+            encode_wait_policy,
+            encode_window,
+        )
 
         return {
             "upstream_mapper": encode_partition_mapper(self.upstream_mapper),
             "window": encode_window(self.window),
+            "wait_policy": encode_wait_policy(self.wait_policy),
         }
 
     @classmethod
     def deserialize(cls, data: dict[str, Any]) -> PartitionMapper:
-        from airflow.serialization.decoders import decode_partition_mapper, 
decode_window
+        from airflow.serialization.decoders import (
+            decode_partition_mapper,
+            decode_wait_policy,
+            decode_window,
+        )
 
         return cls(
             upstream_mapper=decode_partition_mapper(data["upstream_mapper"]),
             window=decode_window(data["window"]),
+            wait_policy=decode_wait_policy(data["wait_policy"]),

Review Comment:
   ```suggestion
               wait_policy=decode_wait_policy(data["wait_policy"]) if 
"wait_policy" in data else WaitForAll()
   ```



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