Skip to content

Commit

Permalink
fix: empty openlineage dataset name for AthenaExtractor (#39677)
Browse files Browse the repository at this point in the history
Signed-off-by: Kacper Muda <mudakacper@gmail.com>
  • Loading branch information
kacpermuda committed May 17, 2024
1 parent 74c3fb3 commit 8d1bd34
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion airflow/providers/amazon/aws/operators/athena.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def get_openlineage_facets_on_start(self) -> OperatorLineage:

if self.output_location:
parsed = urlparse(self.output_location)
outputs.append(Dataset(namespace=f"{parsed.scheme}://{parsed.netloc}", name=parsed.path))
outputs.append(Dataset(namespace=f"{parsed.scheme}://{parsed.netloc}", name=parsed.path or "/"))

return OperatorLineage(job_facets=job_facets, run_facets=run_facets, inputs=inputs, outputs=outputs)

Expand Down
2 changes: 1 addition & 1 deletion tests/providers/amazon/aws/operators/test_athena.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def mock_get_table_metadata(CatalogName, DatabaseName, TableName):
task_id="test_athena_openlineage",
query="INSERT INTO TEST_TABLE SELECT CUSTOMER_EMAIL FROM DISCOUNTS",
database="TEST_DATABASE",
output_location="s3://test_s3_bucket/",
output_location="s3://test_s3_bucket",
client_request_token="eac427d0-1c6d-4dfb-96aa-2835d3ac6595",
sleep_time=0,
max_polling_attempts=3,
Expand Down

0 comments on commit 8d1bd34

Please sign in to comment.