ashb commented on a change in pull request #6715: [AIRFLOW-5945] Make inbuilt 
OperatorLinks work when using Serialization
URL: https://github.com/apache/airflow/pull/6715#discussion_r353112329
 
 

 ##########
 File path: airflow/serialization/serialized_baseoperator.py
 ##########
 @@ -89,7 +96,10 @@ def deserialize_operator(cls, encoded_op: dict) -> 
BaseOperator:
                         operator.__module__ == encoded_op["_task_module"]:
                     op_extra_links_from_plugin.update({ope.name: ope})
 
-        setattr(op, "operator_extra_links", 
list(op_extra_links_from_plugin.values()))
+        # If OperatorLinks is defined in Plugins but not in the Operator
+        # set the Operator links attribute
+        if op_extra_links_from_plugin and "_operator_links_sources" not in 
encoded_op:
+            setattr(op, "operator_extra_links", 
list(op_extra_links_from_plugin.values()))
 
 Review comment:
   What if we define Links in a plugin _and_ in the operator?
   
   I'm finding this code (including the existing code) a bit hard to follow. 
Hmmmm.

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