hussein-awala commented on code in PR #71793:
URL: https://github.com/apache/airflow/pull/71793#discussion_r4493115419
##########
task-sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -1298,6 +1298,13 @@ def startup(msg: StartupDetails) ->
tuple[RuntimeTaskInstance, Context, Logger]:
with _airflow_parsing_context_manager(dag_id=msg.ti.dag_id,
task_id=msg.ti.task_id):
ti = parse(msg, log)
+
+ if conf.getboolean("logging", "dag_tags_in_logs", fallback=False) and
ti.task.dag.tags:
+ # Nested under one key so free-form tags can't overwrite standard log
fields.
+ bind_contextvars(
Review Comment:
The `dag_tags` preamble change still has a gap: `extractTIContext()` returns
the first record containing any task identity field, but startup emits those
records before `dag_tags` is bound. The preamble therefore misses the tags,
while adding them to `tiContextFields` hides them from subsequent log lines.
Could we collect missing context fields from later records and add a
regression test where the first record has task identifiers and a later record
adds `dag_tags`? I reproduced the omission using the current extraction
functions.
--
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]