mhenc commented on PR #29188:
URL: https://github.com/apache/airflow/pull/29188#issuecomment-1412054998

   Regarding `dags: dict[String, Dag]` serialization/deserialization:
   I found that there is a code for it:
   
https://github.com/apache/airflow/blob/main/airflow/serialization/serialized_objects.py#L415
   and
   
https://github.com/apache/airflow/blob/main/airflow/serialization/serialized_objects.py#L476
   
   But for some reason the serialized object doesn't contain `"__type"="dag"` 
so the deserialization doesn't work as expected. 
   This can be easily fixed by changing line
   ```
   return SerializedDAG.serialize_dag(var)
   ```
   
https://github.com/apache/airflow/blob/main/airflow/serialization/serialized_objects.py#L415
   to
   ```
   return cls._encode(SerializedDAG.serialize_dag(var), type_=DAT.DAG)
   ```
   at least it worked for me.
   
   But I am not sure if it won't break something.
   
   @potiuk @ashb  do you have any idea why it is like that? is this code used 
anywhere?
   Note that there are similar cases (like `return 
SerializedBaseOperator.serialize_mapped_operator(var)` few lines below).


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