ashb commented on a change in pull request #6601: [AIRFLOW-6010] Remove cyclic 
imports and pylint disables
URL: https://github.com/apache/airflow/pull/6601#discussion_r350324679
 
 

 ##########
 File path: airflow/serialization/serialized_dag.py
 ##########
 @@ -111,26 +95,26 @@ def deserialize_dag(cls, encoded_dag: dict) -> 
"SerializedDAG":
 
             setattr(dag, k, v)
 
-        # pylint: disable=protected-access
-        keys_to_set_none = dag._serialized_fields - encoded_dag.keys() - 
cls._CONSTRUCTOR_PARAMS.keys()
+        keys_to_set_none = dag.get_serialized_fields() - encoded_dag.keys() - 
cls._CONSTRUCTOR_PARAMS.keys()
         for k in keys_to_set_none:
             setattr(dag, k, None)
 
         setattr(dag, 'full_filepath', dag.fileloc)
         for task in dag.task_dict.values():
             task.dag = dag
-            task = cast(SerializedBaseOperator, task)
+            serializable_task: SerializedBaseOperator = 
cast(SerializedBaseOperator, task)
 
 Review comment:
   Do we need the type annotation and the cast? I would have hoped that one or 
the other is enough?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to