Skip to content

Commit

Permalink
fix: return empty data instead of None when OpenLineage on_start meth…
Browse files Browse the repository at this point in the history
…od is missing (#41268)

Signed-off-by: Kacper Muda <mudakacper@gmail.com>
  • Loading branch information
kacpermuda authored Aug 5, 2024
1 parent d6bc1f6 commit a7353d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion airflow/providers/openlineage/extractors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def _execute_extraction(self) -> OperatorLineage | None:
"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]
Expand Down
2 changes: 1 addition & 1 deletion tests/providers/openlineage/extractors/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a7353d2

Please sign in to comment.