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



##########
File path: airflow/decorators/base.py
##########
@@ -101,27 +102,29 @@ 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: Sequence[str] = ('python_callable',)
 
     def __init__(
         self,
         *,
         python_callable: Callable,
         task_id: str,
-        op_args: Tuple[Any],
-        op_kwargs: Dict[str, Any],
+        op_args: Optional[List] = None,
+        op_kwargs: Optional[Dict] = None,

Review comment:
       ```suggestion
           op_kwargs: Optional[Dict[str, Any]] = None,
   ```

##########
File path: airflow/decorators/base.py
##########
@@ -101,27 +102,29 @@ 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: Sequence[str] = ('python_callable',)
 
     def __init__(
         self,
         *,
         python_callable: Callable,
         task_id: str,
-        op_args: Tuple[Any],
-        op_kwargs: Dict[str, Any],
+        op_args: Optional[List] = None,

Review comment:
       ```suggestion
           op_args: Optional[Sequence] = None,
   ```

##########
File path: airflow/operators/python.py
##########
@@ -131,14 +131,14 @@ def my_python_callable(**kwargs):
     :type show_return_value_in_logs: bool
     """
 
-    template_fields = ('templates_dict', 'op_args', 'op_kwargs')
+    template_fields: Sequence[str] = ('templates_dict', 'op_args', 'op_kwargs')

Review comment:
       Oh well :)

##########
File path: airflow/providers/docker/decorators/docker.py
##########
@@ -79,7 +79,7 @@ def __init__(
             command=command, retrieve_output=True, 
retrieve_output_path="/tmp/script.out", **kwargs
         )
 
-    def execute(self, context: Dict):
+    def execute(self, context: Any):

Review comment:
       ```suggestion
       def execute(self, context: Context):
   ```
   
   I think?




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to