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

 ##########
 File path: airflow/models/baseoperator.py
 ##########
 @@ -235,29 +234,26 @@ class derived from this one results in the creation of a 
task object,
     """
 
     # For derived classes to define which fields will get jinjaified
-    template_fields = []  # type: Iterable[str]
+    template_fields: Iterable[str] = []
     # Defines which files extensions to look for in the templated fields
-    template_ext = []  # type: Iterable[str]
+    template_ext: Iterable[str] = []
     # Defines the color in the UI
     ui_color = '#fff'  # type: str
     ui_fgcolor = '#000'  # type: str
 
     pool = ""  # type: str
 
     # base list which includes all the attrs that don't need deep copy.
-    _base_operator_shallow_copy_attrs = ('user_defined_macros',
-                                         'user_defined_filters',
-                                         'params',
-                                         '_log',)  # type: Iterable[str]
+    BASE_OPERATOR_SHALLOW_COPY_ATTRS: Tuple[str, ...] = \
+        ('user_defined_macros', 'user_defined_filters', 'params', '_log',)
 
     # each operator should override this class attr for shallow copy attrs.
-    shallow_copy_attrs = ()  # type: Iterable[str]
+    shallow_copy_attrs: Tuple[str, ...] = ()
 
     # Defines the operator level extra links
-    operator_extra_links = ()  # type: Iterable[BaseOperatorLink]
+    operator_extra_links: Iterable['BaseOperatorLink'] = ()
 
 Review comment:
   I will try but I think it did not work because BaseOperatorLink is defined 
in the same file below. You can only use real classes when they are imported or 
declared before - so '' is forward-lookup way. But I will double check.

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