mobuchowski commented on code in PR #49237:
URL: https://github.com/apache/airflow/pull/49237#discussion_r2056548263


##########
providers/openlineage/tests/unit/openlineage/plugins/test_adapter.py:
##########
@@ -637,7 +665,17 @@ def test_emit_dag_started_event(mock_stats_incr, 
mock_stats_timer, generate_stat
         nominal_end_time=event_time.isoformat(),
         owners=["airflow"],
         description=dag.description,
-        run_facets={"airflowDagRun": dag_run_facet},
+        run_facets={
+            "parent": parent_run.ParentRunFacet(
+                run=parent_run.Run(runId=random_uuid),
+                job=parent_run.Job(namespace=namespace(), 
name="parent_job_name"),
+                root=parent_run.Root(
+                    run=parent_run.RootRun(runId=random_uuid),
+                    job=parent_run.RootJob(namespace=namespace(), 
name="parent_job_name"),
+                ),
+            ),
+            "airflowDagRun": dag_run_facet,
+        },

Review Comment:
   Done.



##########
providers/snowflake/src/airflow/providers/snowflake/utils/openlineage.py:
##########
@@ -154,13 +164,21 @@ def _get_parent_run_facet(task_instance):
     from airflow.providers.openlineage.conf import namespace
 
     parent_run_id = _get_ol_run_id(task_instance)
+    root_parent_run_id = _get_ol_dag_run_id(task_instance)
 
     return parent_run.ParentRunFacet(
         run=parent_run.Run(runId=parent_run_id),
         job=parent_run.Job(
             namespace=namespace(),
             name=f"{task_instance.dag_id}.{task_instance.task_id}",
         ),
+        root=parent_run.Root(
+            run=parent_run.RootRun(runId=root_parent_run_id),
+            job=parent_run.RootJob(
+                name=task_instance.dag_id,
+                namespace=namespace(),
+            ),
+        ),

Review Comment:
   Done.



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