Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,93 @@
{
"eventType": "START",
"eventTime": "{{ is_datetime(result) }}",
"producer": "{{ result.startswith('https://github.com/apache/airflow/tree/providers-openlineage') }}",
"schemaURL": "{{ result.startswith('https://openlineage.io/spec') }}",
"inputs": [],
"outputs": [],
"run": {
"runId": "{{ is_uuid(result) }}"
"runId": "{{ is_uuid(result) }}",
"facets": {
"parent": {
"job": {
"namespace": "{{ result is string }}",
"name": "openlineage_basic_dag"
},
"run": {
"runId": "{{ is_uuid(result) }}"
}
},
"airflow": {
"dag": {
"dag_id": "openlineage_basic_dag",
"fileloc": "{{ result.endswith('openlineage/example_openlineage.py') }}",
"owner": "airflow",
"start_date": "{{ is_datetime(result) }}"
},
"dagRun": {
"conf": {},
"dag_id": "openlineage_basic_dag",
"data_interval_end": "{{ is_datetime(result) }}",
"data_interval_start": "{{ is_datetime(result) }}",
"start_date": "{{ is_datetime(result) }}"
},
"taskInstance": {
"try_number": "{{ result is number }}",
"queued_dttm": "{{ is_datetime(result) }}",
"log_url": "{{ result is string }}"
},
"task": {
"inlets": "[]",
"mapped": false,
"outlets": "[]",
"task_id": "do_nothing_task",
"trigger_rule": "all_success",
"operator_class": "PythonOperator",
"retries": "{{ result is number }}",
"depends_on_past": false,
"executor_config": {},
"priority_weight": 1,
"multiple_outputs": false,
"upstream_task_ids": "[]",
"downstream_task_ids": "['check_events']",
"operator_class_path": "{{ result.endswith('.PythonOperator') }}",
"wait_for_downstream": false,
"retry_exponential_backoff": false,
"ignore_first_depends_on_past": false,
"wait_for_past_depends_before_skipping": false
},
"taskUuid": "{{ is_uuid(result) }}"
},
"nominalTime": {
"nominalEndTime": "{{ is_datetime(result) }}",
"nominalStartTime": "{{ is_datetime(result) }}"
},
"processing_engine": {
"name": "Airflow",
"openlineageAdapterVersion": "{{ result is string }}",
"version": "{{ result is string }}"
}
}
},
"job": {
"namespace": "default",
"namespace": "{{ result is string }}",
"name": "openlineage_basic_dag.do_nothing_task",
"facets": {
"jobType": {
"integration": "AIRFLOW",
"jobType": "TASK",
"processingType": "BATCH"
},
"ownership": {
"owners": [
{
"name": "{{ result is string }}"
}
]
},
"sourceCode": {
"language": "python",
"sourceCode": "def do_nothing():\n pass\n"
}
}
}
Expand All @@ -21,16 +97,77 @@
"eventType": "COMPLETE",
"eventTime": "{{ is_datetime(result) }}",
"run": {
"runId": "{{ is_uuid(result) }}"
"runId": "{{ is_uuid(result) }}",
"facets": {
"parent": {
"job": {
"namespace": "{{ result is string }}",
"name": "openlineage_basic_dag"
},
"run": {
"runId": "{{ is_uuid(result) }}"
}
},
"airflow": {
"dag": {
"dag_id": "openlineage_basic_dag",
"fileloc": "{{ result.endswith('openlineage/example_openlineage.py') }}",
"owner": "airflow",
"start_date": "{{ is_datetime(result) }}"
},
"dagRun": {
"conf": {},
"dag_id": "openlineage_basic_dag",
"data_interval_end": "{{ is_datetime(result) }}",
"data_interval_start": "{{ is_datetime(result) }}",
"start_date": "{{ is_datetime(result) }}"
},
"taskInstance": {
"try_number": "{{ result is number }}",
"queued_dttm": "{{ is_datetime(result) }}",
"log_url": "{{ result is string }}"
},
"task": {
"inlets": "[]",
"mapped": false,
"outlets": "[]",
"task_id": "do_nothing_task",
"trigger_rule": "all_success",
"operator_class": "PythonOperator",
"retries": "{{ result is number }}",
"depends_on_past": false,
"executor_config": {},
"priority_weight": 1,
"multiple_outputs": false,
"upstream_task_ids": "[]",
"downstream_task_ids": "['check_events']",
"operator_class_path": "{{ result.endswith('.PythonOperator') }}",
"wait_for_downstream": false,
"retry_exponential_backoff": false,
"ignore_first_depends_on_past": false,
"wait_for_past_depends_before_skipping": false
},
"taskUuid": "{{ is_uuid(result) }}"
},
"processing_engine": {
"name": "Airflow",
"openlineageAdapterVersion": "{{ result is string }}",
"version": "{{ result is string }}"
}
}
},
"job": {
"namespace": "default",
"namespace": "{{ result is string }}",
"name": "openlineage_basic_dag.do_nothing_task",
"facets": {
"jobType": {
"integration": "AIRFLOW",
"jobType": "TASK",
"processingType": "BATCH"
},
"sourceCode": {
"language": "python",
"sourceCode": "def do_nothing():\n pass\n"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
# under the License.
from __future__ import annotations

import os
from datetime import datetime
from pathlib import Path

from providers.openlineage.tests.system.openlineage.operator import OpenLineageTestOperator

Expand All @@ -43,7 +43,7 @@ def do_nothing():

check_events = OpenLineageTestOperator(
task_id="check_events",
file_path=f"{os.getenv('AIRFLOW_HOME')}/dags/providers/tests/system/openlineage/example_openlineage.json",
file_path=str(Path(__file__).parent / "example_openlineage.json"),
)

nothing_task >> check_events
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import os
from datetime import datetime, timedelta
from pathlib import Path

from providers.openlineage.tests.system.openlineage.operator import OpenLineageTestOperator

Expand Down Expand Up @@ -68,7 +69,7 @@ def check_start_amount_func():

check_events = OpenLineageTestOperator(
task_id="check_events",
file_path=f"{os.getenv('AIRFLOW_HOME')}/dags/providers/tests/system/openlineage/example_openlineage_mapped_sensor.json",
file_path=str(Path(__file__).parent / "example_openlineage_mapped_sensor.json"),
allow_duplicate_events=True,
)

Expand Down