potiuk commented on code in PR #30380:
URL: https://github.com/apache/airflow/pull/30380#discussion_r1167143594
##########
airflow/cli/commands/task_command.py:
##########
@@ -450,13 +448,12 @@ def task_failed_deps(args):
dep_context = DepContext(deps=SCHEDULER_QUEUED_DEPS)
failed_deps = list(ti.get_failed_dep_statuses(dep_context=dep_context))
- # TODO, Do we want to print or log this
if failed_deps:
- print("Task instance dependencies not met:")
Review Comment:
Correct. All the command lines have `@suppress_logs_and_warnings` set so
that the output is "clen" and does not contain extra stuff thet it should not
be there. Particularly when `--output json` is used and eny extra print could
for example break anythong that parses "json". So some of the print methods are
deliberatly using print and not log because otherwise they would be suppressed.
I think this change shoudl be changed in something different. It should
review all such `print` calls and possibly replace them with another methos
(`print_to_command_output`) and the command should have appropriate docstring
explaining it's purpose.
Then all the "expected" prints should remain and use this dedicated
function, and all the "accidental" ones should be turned into logs.
This could avoid any future attempts of converting those prints and no
further explanation and asking "elders" will be needed :)
--
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]