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 a7353d200e fix: return empty data instead of None when OpenLineage 
on_start method is missing (#41268)
a7353d200e is described below

commit a7353d200e2800102cf1834a9fce5aa8cde35093
Author: Kacper Muda <[email protected]>
AuthorDate: Mon Aug 5 18:41:03 2024 +0200

    fix: return empty data instead of None when OpenLineage on_start method is 
missing (#41268)
    
    Signed-off-by: Kacper Muda <[email protected]>
---
 airflow/providers/openlineage/extractors/base.py    | 2 +-
 tests/providers/openlineage/extractors/test_base.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/airflow/providers/openlineage/extractors/base.py 
b/airflow/providers/openlineage/extractors/base.py
index da175866a0..ceb10ff8b1 100644
--- a/airflow/providers/openlineage/extractors/base.py
+++ b/airflow/providers/openlineage/extractors/base.py
@@ -113,7 +113,7 @@ class DefaultExtractor(BaseExtractor):
                 "Operator %s does not have the get_openlineage_facets_on_start 
method.",
                 self.operator.task_type,
             )
-            return None
+            return OperatorLineage()
 
     def extract_on_complete(self, task_instance) -> OperatorLineage | None:
         failed_states = [TaskInstanceState.FAILED, 
TaskInstanceState.UP_FOR_RETRY]
diff --git a/tests/providers/openlineage/extractors/test_base.py 
b/tests/providers/openlineage/extractors/test_base.py
index ee242d6dfc..88234d3174 100644
--- a/tests/providers/openlineage/extractors/test_base.py
+++ b/tests/providers/openlineage/extractors/test_base.py
@@ -224,7 +224,7 @@ def test_extraction_without_on_start():
         task_instance=task_instance
     )
 
-    assert metadata is None
+    assert metadata == OperatorLineage()
 
     assert metadata_on_complete == OperatorLineage(
         inputs=INPUTS,

Reply via email to