Skip to content

Commit

Permalink
fix(ingest/nifi): make s3 dataset urn consistent with s3 source (#9599)
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurinehate authored Jan 12, 2024
1 parent f05056a commit b0426ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions metadata-ingestion/src/datahub/ingestion/source/nifi.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,10 @@ def process_s3_provenance_event(self, event):

s3_url = f"s3://{s3_bucket}/{s3_key}"
s3_url = s3_url[: s3_url.rindex("/")]
dataset_name = s3_url.replace("s3://", "").replace("/", ".")
s3_path = s3_url[len("s3://") :]
dataset_name = s3_path.replace("/", ".")
platform = "s3"
dataset_urn = builder.make_dataset_urn(platform, dataset_name, self.env)
dataset_urn = builder.make_dataset_urn(platform, s3_path, self.env)
return ExternalDataset(
platform,
dataset_name,
Expand Down
2 changes: 1 addition & 1 deletion metadata-ingestion/tests/unit/test_nifi_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_nifi_s3_provenance_event():

ioAspect = workunits[4].metadata.aspect
assert ioAspect.outputDatasets == [
"urn:li:dataset:(urn:li:dataPlatform:s3,foo-nifi.tropical_data,PROD)"
"urn:li:dataset:(urn:li:dataPlatform:s3,foo-nifi/tropical_data,PROD)"
]
assert ioAspect.inputDatasets == []

Expand Down

0 comments on commit b0426ae

Please sign in to comment.