dstandish commented on code in PR #63568:
URL: https://github.com/apache/airflow/pull/63568#discussion_r2975900879
##########
airflow-core/src/airflow/models/dagrun.py:
##########
@@ -1020,21 +1026,33 @@ def is_effective_leaf(task):
return leaf_tis
def _emit_dagrun_span(self, state: DagRunState):
+ # just to be safe
+ if not isinstance(self.context_carrier, dict):
+ return
+
ctx = TraceContextTextMapPropagator().extract(self.context_carrier)
span = trace.get_current_span(context=ctx)
span_context = span.get_span_context()
with override_ids(span_context.trace_id, span_context.span_id):
- attributes = {
+ attributes: dict[str, str] = {
"airflow.dag_id": str(self.dag_id),
"airflow.dag_run.run_id": self.run_id,
}
+ if self.start_date:
+ attributes["airflow.dag_run.start_date"] = str(self.start_date)
Review Comment:
yeah you could set it as an integer, but not very user friendly in the tool.
and the tool would then not necessarily know how to interpret it (since you
can't give a type hint). "what does this integer mean?" you'd have to infer
from the attr name, which is more problematic. but if it's an iso datetime
string then you can just try to parse it.
--
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]