dstandish commented on code in PR #27758: URL: https://github.com/apache/airflow/pull/27758#discussion_r1072693300
########## airflow/cli/commands/task_command.py: ########## @@ -69,6 +70,18 @@ CreateIfNecessary = Union[Literal[False], Literal["db"], Literal["memory"]] +def _set_task_deferred_context_var(): + """ + Tell task log handler that task exited with deferral. + + :meta private: + """ + logger = logging.getLogger() + h = next((h for h in logger.handlers if hasattr(h, "ctx_task_deferred")), None) + if h: + h.ctx_task_deferred = True Review Comment: curious, is the rationale here to avoid the "truthy" evaluation on h? -- 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]
