kacpermuda commented on code in PR #36067:
URL: https://github.com/apache/airflow/pull/36067#discussion_r1415763538
##########
tests/providers/openlineage/plugins/test_openlineage_adapter.py:
##########
@@ -206,6 +296,63 @@ def test_emit_complete_event(mock_stats_incr,
mock_stats_timer):
mock_stats_timer.assert_called_with("ol.emit.attempts")
[email protected]("airflow.providers.openlineage.plugins.adapter.Stats.timer")
[email protected]("airflow.providers.openlineage.plugins.adapter.Stats.incr")
+def test_emit_complete_event_with_additional_information(mock_stats_incr,
mock_stats_timer):
+ client = MagicMock()
+ adapter = OpenLineageAdapter(client)
+
+ run_id = str(uuid.uuid4())
+ event_time = datetime.datetime.now().isoformat()
+ adapter.complete_task(
+ run_id=run_id,
+ end_time=event_time,
+ parent_job_name="parent_job_name",
+ parent_run_id="parent_run_id",
+ job_name="job",
+ task=OperatorLineage(
+ inputs=[Dataset(namespace="bigquery", name="a.b.c"),
Dataset(namespace="bigquery", name="x.y.z")],
+ outputs=[Dataset(namespace="gs://bucket", name="exported_folder")],
+ job_facets={"sql3": SqlJobFacet(query="SELECT 3;")},
+ run_facets={"sql1": SqlJobFacet(query="SELECT 1;")},
+ ),
+ )
+
+ assert (
+ call(
+ RunEvent(
+ eventType=RunState.COMPLETE,
+ eventTime=event_time,
+ run=Run(
+ runId=run_id,
+ facets={
+ "parent": ParentRunFacet(
+ run={"runId": "parent_run_id"},
+ job={"namespace": "default", "name":
"parent_job_name"},
+ ),
+ "parentRun": ParentRunFacet(
+ run={"runId": "parent_run_id"},
+ job={"namespace": "default", "name":
"parent_job_name"},
+ ),
+ "sql1": SqlJobFacet(query="SELECT 1;"),
Review Comment:
Let's use the above topic to discuss this, as this is the same case.
--
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]