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_r353113943
 
 

 ##########
 File path: airflow/serialization/serialized_baseoperator.py
 ##########
 @@ -124,3 +142,50 @@ def _is_excluded(cls, var, attrname, op):
             # Don't store empty executor config or params dicts.
             return True
         return super()._is_excluded(var, attrname, op)
+
+    @classmethod
+    def _deserialize_operator_extra_links(
+        cls,
+        encoded_op_links: list
+    ) -> Dict[str, BaseOperatorLink]:
+        """
+        Deserialize Operator Links by importing all the modules containing 
operator links
+        defined in the serialized dict and initialize them by passing 
arguments using cattr.
+
+        :param encoded_op_links: Serialized Operator Link
+        :return: De-Serialized Operator Link
+        """
+
+        # Extra Operator Links
+        op_predefined_extra_links = {}
+
+        for _operator_links_source in encoded_op_links:
+            _operator_link_class, data = 
list(_operator_links_source.items())[0]
+            try:
+                single_link = import_string(_operator_link_class)
 
 Review comment:
   I'm not sure if we should do this here (the import string) - my first 
thought was that we should look through the loaded plugins only.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to