ashb commented on code in PR #66036:
URL: https://github.com/apache/airflow/pull/66036#discussion_r3160909078


##########
airflow-core/src/airflow/ui/src/pages/TaskInstance/Logs/utils.ts:
##########
@@ -60,6 +64,14 @@ export const getDownloadText = ({
       translate,
     }),
   );
+
+  const tiContext = extractTIContext(lines);
+
+  if (Object.keys(tiContext).length > 0) {
+    rendered.unshift(renderTIContextPreamble(tiContext, "text", "Task 
Identity") as string);
+  }
+
+  return rendered;

Review Comment:
   Unfortunately this isn't possible as it makes the output of download/paste 
slightly "odd" looking. Note that the `Task Identity` log line appears _after_ 
the group (where as in the UI it's hoisted above it.
   
   ```
   ::group::Log message source details 
sources=["/Users/ash/code/astro/airflow_home/logs/dag_id=low_latency_test/run_id=manual__2026-04-29T12:13:22.776974+00:00/task_id=first/attempt=1.log"]
 
   ::endgroup::
   [2026-04-29T12:13:23.560052Z] INFO - ::group::Pre Execute
   Task Identity ti_id=019dd928-7df4-7f0a-bb76-c53b4c81c214 
dag_id=low_latency_test task_id=first 
run_id=manual__2026-04-29T12:13:22.776974+00:00 try_number=1 map_index=-1
   ask
   [2026-04-29T12:13:25.026749Z] INFO - DAG bundles loaded: dags-folder
   [2026-04-29T12:13:25.031783Z] INFO - DAG not in cache, doing a fresh parse
   [2026-04-29T12:13:25.032114Z] INFO - Filling up the DagBag from 
/home/astro/dags/example_low_latency.py
   [2026-04-29T12:13:25.055289Z] INFO - TaskInstance Details:  
dagrun_id=manual__2026-04-29T12:13:22.776974+00:00  
run_start_date=2026-04-29T12:13:24.932095Z  
op_classpath=["airflow.providers.standard.decorators.python._PythonDecoratedOperator","airflow.sdk.bases.decorator.DecoratedOperator","airflow.providers.standard.operators.python.PythonOperator","airflow.sdk.bases.operator.BaseAsyncOperator"]
 
   [2026-04-29T12:13:25.055627Z] INFO - astro sla event: flushing 
AstroSlaEvents count=1 
   [2026-04-29T12:13:25.066932Z] INFO - ::endgroup::
   [2026-04-29T12:13:25.068628Z] INFO - Done. Returned value was: {'status': 
'first_done', 'start_ts': '2026-04-29T12:13:25.068573+00:00'}
   [2026-04-29T12:13:25.068923Z] INFO - ::group::Post Execute
   [2026-04-29T12:13:25.069013Z] INFO - Pushing xcom 
ti=RuntimeTaskInstance(id=UUID('019dd928-7df4-7f0a-bb76-c53b4c81c214'), 
task_id='first', dag_id='low_latency_test', 
run_id='manual__2026-04-29T12:13:22.776974+00:00', try_number=1, 
dag_version_id=UUID('019dd927-9f50-7dc6-becc-30fc30ebed4a'), map_index=-1, 
hostname='7430f488eef0', context_carrier={'traceparent': 
'00-ae300d0f93945aba5ce9c42bf77861dd-dcfcd301b37b2cd7-01'}, 
task=<Task(_PythonDecoratedOperator): first>, 
bundle_instance=LocalDagBundle(name=dags-folder), max_tries=0, 
start_date=datetime.datetime(2026, 4, 29, 12, 13, 24, 932095, 
tzinfo=datetime.timezone.utc), end_date=None, state=<TaskInstanceState.RUNNING: 
'running'>, is_mapped=False, rendered_map_index=None, sentry_integration='') 
   [2026-04-29T12:13:25.110942Z] INFO - ::endgroup::
   ```
   
   



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