dstandish commented on code in PR #62554:
URL: https://github.com/apache/airflow/pull/62554#discussion_r2912638585


##########
airflow-core/src/airflow/executors/workloads/task.py:
##########
@@ -86,7 +86,7 @@ def make(
         from airflow.utils.helpers import log_filename_template_renderer
 
         ser_ti = TaskInstanceDTO.model_validate(ti, from_attributes=True)
-        ser_ti.parent_context_carrier = ti.dag_run.context_carrier
+        ser_ti.context_carrier = ti.dag_run.context_carrier

Review Comment:
   what's going on here is that previously we created the task spans in the 
scheduler
   
   the model airflow.sdk.api.datamodels._generated.TaskInstance only has one 
context_carrier attribute. this now means the dag run span.
   
   i don't think this ever really should have been exposed to users. if it's 
currently exposed to users, maybe it would make sense to underscore it or at 
least put a deprecation warning if we really think we can't remove it / change 
it. but to me it feels very very internal.
   
   now the task span is there during user code execution and they can get it 
with normal otel logic, i.e. trace.get_current_span()
   
   they could get the context carrier from that in the normal way.
   
   and they can create child spans with just `with 
trace.start_as_current_span(...)`
   



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