vemikhaylov commented on code in PR #29608:
URL: https://github.com/apache/airflow/pull/29608#discussion_r1117956211
##########
airflow/cli/commands/task_command.py:
##########
@@ -596,6 +597,10 @@ def task_test(args, dag=None):
task, args.map_index,
exec_date_or_run_id=args.execution_date_or_run_id, create_if_necessary="db"
)
+ xcoms = args.xcoms or []
+ _validate_injected_xcoms(xcoms, task)
Review Comment:
If we stick to the `ti.inject_xcoms` approach, then it may be considered
moving the validation logic to `ti.inject_xcoms` itself. It'll imply that if
`inject_xcoms` is called, it should inject all the required XComs at once, but
probably that's fine.
Also the exception raised from there will lack the `"Please, pass them via
the --xcoms argument (see --help for more details)."` part (in the context of
the method we won't know where it's called from). It will need either to be
caught and added in `task_command` or omitted.
--
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]