This is an automated email from the ASF dual-hosted git repository.
mobuchowski pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 173442e7951 Add non serializable asset's extra to openlineage e2e
tests (#75094)
173442e7951 is described below
commit 173442e79516ded397ecec24060d61c0aa0c3aa2
Author: Kacper Muda <[email protected]>
AuthorDate: Mon Oct 19 17:33:26 2026 +0200
Add non serializable asset's extra to openlineage e2e tests (#75094)
---
.../openlineage/example_openlineage_base_complex_dag.py | 15 +++++++++++++--
.../openlineage_base_complex_dag__af2.json | 12 ++++++++----
.../openlineage_base_complex_dag__af3.json | 16 ++++++++--------
3 files changed, 29 insertions(+), 14 deletions(-)
diff --git
a/providers/openlineage/tests/system/openlineage/example_openlineage_base_complex_dag.py
b/providers/openlineage/tests/system/openlineage/example_openlineage_base_complex_dag.py
index d843fb6c7c4..8f9dc8ce919 100644
---
a/providers/openlineage/tests/system/openlineage/example_openlineage_base_complex_dag.py
+++
b/providers/openlineage/tests/system/openlineage/example_openlineage_base_complex_dag.py
@@ -97,7 +97,13 @@ with DAG(
task_2 = PythonOperator(
task_id="task_2",
python_callable=do_nothing,
- inlets=[Asset(uri="file://host1/dir2/file2.txt"),
Asset(uri="unknown_scheme://host1/dir2/file3.txt")],
+ inlets=[
+ Asset(
+ uri="file://host1/dir2/file2.txt",
+ extra={"etag": '"0x8D0000000000001"', "owner": "O'Brien",
"has_header": True, "note": None},
+ ),
+ Asset(uri="unknown_scheme://host1/dir2/file3.txt"),
+ ],
max_retry_delay=42,
doc="text doc",
doc_md="should be skipped",
@@ -107,7 +113,12 @@ with DAG(
)
task_3 = EmptyOperator(
task_id="task_3",
- outlets=[Asset(uri="file://host/dir/file.txt")],
+ outlets=[
+ Asset(
+ uri="file://host/dir/file.txt",
+ extra={"checks": [{"passed": True}], "ratio": 0.5},
+ )
+ ],
doc_md="MD doc",
doc_json="should be skipped",
doc_yaml="should be skipped",
diff --git
a/providers/openlineage/tests/system/openlineage/expected_events/openlineage_base_complex_dag__af2.json
b/providers/openlineage/tests/system/openlineage/expected_events/openlineage_base_complex_dag__af2.json
index 4e22417b9a4..db9e65e094b 100644
---
a/providers/openlineage/tests/system/openlineage/expected_events/openlineage_base_complex_dag__af2.json
+++
b/providers/openlineage/tests/system/openlineage/expected_events/openlineage_base_complex_dag__af2.json
@@ -688,10 +688,11 @@
"downstream_task_ids": "{{ 'task_3' in result and
'check_events' in result }}",
"executor_config": {},
"ignore_first_depends_on_past": "{{ result == true }}",
- "inlets": "[{'uri': 'file://host1/dir2/file2.txt',
'extra': None, 'type': 'asset'}, {'uri':
'unknown_scheme://host1/dir2/file3.txt', 'extra': None, 'type': 'asset'}]",
+ "inlets": "[{'uri': 'file://host1/dir2/file2.txt',
'extra': {'etag': '\"0x8D0000000000001\"', 'owner': \"O'Brien\", 'has_header':
True, 'note': None}, 'type': 'asset'}, {'uri':
'unknown_scheme://host1/dir2/file3.txt', 'extra': None, 'type': 'asset'}]",
"inlets_list": [
{
"uri": "file://host1/dir2/file2.txt",
+ "extra": {"etag": "\"0x8D0000000000001\"",
"owner": "O'Brien", "has_header": true},
"type": "asset"
},
{
@@ -881,10 +882,11 @@
"downstream_task_ids": "{{ 'task_3' in result and
'check_events' in result }}",
"executor_config": {},
"ignore_first_depends_on_past": "{{ result == true }}",
- "inlets": "[{'uri': 'file://host1/dir2/file2.txt',
'extra': None, 'type': 'asset'}, {'uri':
'unknown_scheme://host1/dir2/file3.txt', 'extra': None, 'type': 'asset'}]",
+ "inlets": "[{'uri': 'file://host1/dir2/file2.txt',
'extra': {'etag': '\"0x8D0000000000001\"', 'owner': \"O'Brien\", 'has_header':
True, 'note': None}, 'type': 'asset'}, {'uri':
'unknown_scheme://host1/dir2/file3.txt', 'extra': None, 'type': 'asset'}]",
"inlets_list": [
{
"uri": "file://host1/dir2/file2.txt",
+ "extra": {"etag": "\"0x8D0000000000001\"",
"owner": "O'Brien", "has_header": true},
"type": "asset"
},
{
@@ -1076,10 +1078,11 @@
"operator_class": "EmptyOperator",
"operator_class_path":
"airflow.providers.standard.operators.empty.EmptyOperator",
"operator_provider_version": "{{ regex_match(result,
\"^[\\d]+\\.[\\d]+\\.[\\d]+.*\") }}",
- "outlets": "[{'uri': 'file://host/dir/file.txt',
'extra': None, 'type': 'asset'}]",
+ "outlets": "[{'uri': 'file://host/dir/file.txt',
'extra': {'checks': [{'passed': True}], 'ratio': 0.5}, 'type': 'asset'}]",
"outlets_list": [
{
"uri": "file://host/dir/file.txt",
+ "extra": {"checks": [{"passed": true}],
"ratio": 0.5},
"type": "asset"
}
],
@@ -1258,10 +1261,11 @@
"operator_class": "EmptyOperator",
"operator_class_path":
"airflow.providers.standard.operators.empty.EmptyOperator",
"operator_provider_version": "{{ regex_match(result,
\"^[\\d]+\\.[\\d]+\\.[\\d]+.*\") }}",
- "outlets": "[{'uri': 'file://host/dir/file.txt',
'extra': None, 'type': 'asset'}]",
+ "outlets": "[{'uri': 'file://host/dir/file.txt',
'extra': {'checks': [{'passed': True}], 'ratio': 0.5}, 'type': 'asset'}]",
"outlets_list": [
{
"uri": "file://host/dir/file.txt",
+ "extra": {"checks": [{"passed": true}],
"ratio": 0.5},
"type": "asset"
}
],
diff --git
a/providers/openlineage/tests/system/openlineage/expected_events/openlineage_base_complex_dag__af3.json
b/providers/openlineage/tests/system/openlineage/expected_events/openlineage_base_complex_dag__af3.json
index e7527369849..6a4ad2122e5 100644
---
a/providers/openlineage/tests/system/openlineage/expected_events/openlineage_base_complex_dag__af3.json
+++
b/providers/openlineage/tests/system/openlineage/expected_events/openlineage_base_complex_dag__af3.json
@@ -680,11 +680,11 @@
"downstream_task_ids": "{{ 'task_3' in result and
'check_events' in result }}",
"executor_config": {},
"ignore_first_depends_on_past": false,
- "inlets": "[{'uri': 'file://host1/dir2/file2.txt',
'extra': {}, 'type': 'asset'}, {'uri': 'unknown_scheme://host1/dir2/file3.txt',
'extra': {}, 'type': 'asset'}]",
+ "inlets": "[{'uri': 'file://host1/dir2/file2.txt',
'extra': {'etag': '\"0x8D0000000000001\"', 'owner': \"O'Brien\", 'has_header':
True, 'note': None}, 'type': 'asset'}, {'uri':
'unknown_scheme://host1/dir2/file3.txt', 'extra': {}, 'type': 'asset'}]",
"inlets_list": [
{
"uri": "file://host1/dir2/file2.txt",
- "extra": {},
+ "extra": {"etag": "\"0x8D0000000000001\"",
"owner": "O'Brien", "has_header": true},
"type": "asset"
},
{
@@ -870,11 +870,11 @@
"downstream_task_ids": "{{ 'task_3' in result and
'check_events' in result }}",
"executor_config": {},
"ignore_first_depends_on_past": false,
- "inlets": "[{'uri': 'file://host1/dir2/file2.txt',
'extra': {}, 'type': 'asset'}, {'uri': 'unknown_scheme://host1/dir2/file3.txt',
'extra': {}, 'type': 'asset'}]",
+ "inlets": "[{'uri': 'file://host1/dir2/file2.txt',
'extra': {'etag': '\"0x8D0000000000001\"', 'owner': \"O'Brien\", 'has_header':
True, 'note': None}, 'type': 'asset'}, {'uri':
'unknown_scheme://host1/dir2/file3.txt', 'extra': {}, 'type': 'asset'}]",
"inlets_list": [
{
"uri": "file://host1/dir2/file2.txt",
- "extra": {},
+ "extra": {"etag": "\"0x8D0000000000001\"",
"owner": "O'Brien", "has_header": true},
"type": "asset"
},
{
@@ -1061,11 +1061,11 @@
"operator_class": "EmptyOperator",
"operator_class_path":
"airflow.providers.standard.operators.empty.EmptyOperator",
"operator_provider_version": "{{ regex_match(result,
\"^[\\d]+\\.[\\d]+\\.[\\d]+.*\") }}",
- "outlets": "[{'uri': 'file://host/dir/file.txt',
'extra': {}, 'type': 'asset'}]",
+ "outlets": "[{'uri': 'file://host/dir/file.txt',
'extra': {'checks': [{'passed': True}], 'ratio': 0.5}, 'type': 'asset'}]",
"outlets_list": [
{
"uri": "file://host/dir/file.txt",
- "extra": {},
+ "extra": {"checks": [{"passed": true}],
"ratio": 0.5},
"type": "asset"
}
],
@@ -1239,11 +1239,11 @@
"operator_class": "EmptyOperator",
"operator_class_path":
"airflow.providers.standard.operators.empty.EmptyOperator",
"operator_provider_version": "{{ regex_match(result,
\"^[\\d]+\\.[\\d]+\\.[\\d]+.*\") }}",
- "outlets": "[{'uri': 'file://host/dir/file.txt',
'extra': {}, 'type': 'asset'}]",
+ "outlets": "[{'uri': 'file://host/dir/file.txt',
'extra': {'checks': [{'passed': True}], 'ratio': 0.5}, 'type': 'asset'}]",
"outlets_list": [
{
"uri": "file://host/dir/file.txt",
- "extra": {},
+ "extra": {"checks": [{"passed": true}],
"ratio": 0.5},
"type": "asset"
}
],