kaxil commented on a change in pull request #20743:
URL: https://github.com/apache/airflow/pull/20743#discussion_r784800398



##########
File path: airflow/serialization/serialized_objects.py
##########
@@ -586,9 +604,24 @@ def serialize_operator(cls, op: BaseOperator) -> Dict[str, 
Any]:
         return serialize_op
 
     @classmethod
-    def deserialize_operator(cls, encoded_op: Dict[str, Any]) -> BaseOperator:
+    def deserialize_operator(cls, encoded_op: Dict[str, Any]) -> 
Union[BaseOperator, MappedOperator]:
         """Deserializes an operator from a JSON object."""
-        op = SerializedBaseOperator(task_id=encoded_op['task_id'])
+        op: Union[BaseOperator, MappedOperator]
+        # Check if it's a mapped operator
+        if "mapped_kwargs" in encoded_op:
+            op = MappedOperator(
+                task_id=encoded_op['task_id'],
+                dag=None,
+                operator_class='.'.join(filter(None, 
(encoded_op['_task_module'], encoded_op['_task_type']))),
+                # These are all re-set later
+                partial_kwargs={},
+                mapped_kwargs={},
+                deps=tuple(),
+                is_dummy=False,
+                template_fields=(),

Review comment:
       Same for these three, shouldn't we have a default on `MappedOperator` 
itself?




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