You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/12/17 11:29:25 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #20034: Fix MyPy errors for Airflow decorators

uranusjr commented on a change in pull request #20034:
URL: https://github.com/apache/airflow/pull/20034#discussion_r771324583



##########
File path: airflow/decorators/base.py
##########
@@ -101,22 +102,22 @@ class DecoratedOperator(BaseOperator):
     :type kwargs_to_upstream: dict
     """
 
-    template_fields: Iterable[str] = ('op_args', 'op_kwargs')
+    template_fields: Sequence[str] = ('op_args', 'op_kwargs')
     template_fields_renderers = {"op_args": "py", "op_kwargs": "py"}
 
     # since we won't mutate the arguments, we should just do the shallow copy
     # there are some cases we can't deepcopy the objects (e.g protobuf).
-    shallow_copy_attrs = ('python_callable',)
+    shallow_copy_attrs: Tuple[str, ...] = ('python_callable',)

Review comment:
       We should change the type hint on `BaseOperator` to `Sequence`. It does not make sense to restrict it to `Tuple`.




-- 
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-unsubscribe@airflow.apache.org

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