ashb commented on code in PR #55194:
URL: https://github.com/apache/airflow/pull/55194#discussion_r2334013864


##########
devel-common/src/tests_common/test_utils/mock_operators.py:
##########
@@ -198,3 +198,22 @@ class GithubLink(BaseOperatorLink):
 
     def get_link(self, operator, *, ti_key):
         return "https://github.com/apache/airflow";
+
+
+class InitCustomLink(BaseOperatorLink):
+    name = "Google"
+
+    def get_link(self, operator, ti_key):
+        return "https://www.google.com";
+
+
+class InitExtraLinksOperator(BaseOperator):
+    """Custom operator to test operator_extra_links defined in __init__."""
+
+    def __init__(self, value=None, **kwargs):
+        super().__init__(**kwargs)
+        self.value = value
+        self.operator_extra_links = (InitCustomLink(),)

Review Comment:
   It's uncommon, but I think we should mix class_level ones and ones added in 
init
   ```suggestion
   class InitExtraLinksOperator(BaseOperator):
       """Custom operator to test operator_extra_links defined in __init__."""
       
       operator_extra_links = (SomeLink)
   
       def __init__(self, value=None, **kwargs):
           super().__init__(**kwargs)
           self.value = value
           if value == "VAL_1":
               self.operator_extra_links = (InitCustomLink(),)
           elif value:
               self.operator_extra_links += (InitCustomLink(),)        
   ```



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to