kacpermuda commented on code in PR #49237:
URL: https://github.com/apache/airflow/pull/49237#discussion_r2058028094
##########
providers/openlineage/src/airflow/providers/openlineage/plugins/macros.py:
##########
@@ -101,3 +87,44 @@ def lineage_parent_id(task_instance: TaskInstance):
lineage_run_id(task_instance),
)
)
+
+
+def lineage_root_parent_id(task_instance: TaskInstance):
+ return "/".join(
+ (
+ lineage_job_namespace(),
+ lineage_root_job_name(task_instance),
+ lineage_root_run_id(task_instance),
+ )
+ )
+
+
+def lineage_root_job_name(task_instance: TaskInstance):
+ return task_instance.dag_id
+
+
+def lineage_root_run_id(task_instance: TaskInstance):
+ return OpenLineageAdapter.build_dag_run_id(
+ dag_id=task_instance.dag_id,
+ logical_date=_get_logical_date(task_instance),
+ clear_number=task_instance.dag_run.clear_number,
+ )
Review Comment:
I was thinking about using DAGRun.conf to pass some OL information, then we
could probably access it from ti level and have access to real root parent id
--
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]