Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: return empty data instead of None when OpenLineage on_start method is missing #41268

Merged
merged 1 commit into from
Aug 5, 2024
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
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