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 2023/01/01 22:54:15 UTC

[GitHub] [airflow] vemikhaylov commented on a diff in pull request #28667: Fix params passing to TaskFlow tasks run with CLI

vemikhaylov commented on code in PR #28667:
URL: https://github.com/apache/airflow/pull/28667#discussion_r1059802850


##########
airflow/cli/commands/task_command.py:
##########
@@ -560,6 +561,9 @@ def task_test(args, dag=None):
     if args.task_params:
         passed_in_params = json.loads(args.task_params)
         task.params.update(passed_in_params)
+        if isinstance(task, DecoratedOperator):
+            task.op_args = []
+            task.op_kwargs.update(passed_in_params)

Review Comment:
   I'm not 100% sure that this is the best place to override this. Probably the args should rather be overridden somewhere closer to `execute` (e.g., https://github.com/apache/airflow/blob/main/airflow/operators/python.py#L174).
   
   I lack clear understanding what `params` are / should be used for as opposed to `op_args` and `op_kwargs`, so overriding here looked like a safer change to me.



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