hanxdatadog commented on code in PR #71793:
URL: https://github.com/apache/airflow/pull/71793#discussion_r4602494282


##########
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:
   Fixed: `extractTIContext()` now merges context fields across records (first 
non-null value per field wins, stopping once all are found), so `dag_tags` 
bound after startup reaches the preamble. Added a regression test where the 
first record has the task identifiers and a later one adds `dag_tags`.
   
   ---
   Drafted-by: Claude Code (Opus 5.5); reviewed by @hanxdatadog before posting



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

Reply via email to