Content-Length: 328087 | pFad | http://github.com/apache/airflow/commit/a500cafafe86d543ecec92ad63cea85f356d9728

BB expose OpenLineage's lineage_root_* macros in plugin (#50532) · apache/airflow@a500caf · GitHub
Skip to content

Commit a500caf

Browse files
authored
expose OpenLineage's lineage_root_* macros in plugin (#50532)
Signed-off-by: Maciej Obuchowski <maciej.obuchowski@datadoghq.com>
1 parent 38a1a48 commit a500caf

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

providers/openlineage/src/airflow/providers/openlineage/plugins/macros.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@ def lineage_parent_id(task_instance: TaskInstance):
9090

9191

9292
def lineage_root_parent_id(task_instance: TaskInstance):
93+
"""
94+
Macro function which returns a unique identifier of given task that can be used to create root information for ParentRunFacet.
95+
96+
This identifier is composed of the namespace, dag name, and generated run id for given dag, structured
97+
as '{namespace}/{job_name}/{run_id}'.
98+
99+
.. seealso::
100+
For more information take a look at the guide:
101+
:ref:`howto/macros:openlineage`
102+
"""
93103
return "/".join(
94104
(
95105
lineage_job_namespace(),

providers/openlineage/src/airflow/providers/openlineage/plugins/openlineage.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
lineage_job_name,
2424
lineage_job_namespace,
2525
lineage_parent_id,
26+
lineage_root_job_name,
27+
lineage_root_parent_id,
28+
lineage_root_run_id,
2629
lineage_run_id,
2730
)
2831

@@ -37,7 +40,15 @@ class OpenLineageProviderPlugin(AirflowPlugin):
3740

3841
name = "OpenLineageProviderPlugin"
3942
if not conf.is_disabled():
40-
macros = [lineage_job_namespace, lineage_job_name, lineage_run_id, lineage_parent_id]
43+
macros = [
44+
lineage_job_namespace,
45+
lineage_job_name,
46+
lineage_run_id,
47+
lineage_parent_id,
48+
lineage_root_run_id,
49+
lineage_root_job_name,
50+
lineage_root_parent_id,
51+
]
4152
listeners = [get_openlineage_listener()]
4253
from airflow.lineage.hook import HookLineageReader
4354

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/apache/airflow/commit/a500cafafe86d543ecec92ad63cea85f356d9728

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy