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

feat(ingest/unity-catalog): Support external S3 lineage #9025

Merged

Conversation

asikowitz
Copy link
Collaborator

@treff7es can you explain why make_s3_urn removes the period in the extension. I had to undo that for external lineage to match urns, as the S3 source creates urns with periods in them. Do you know if we can make this consistent?

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Oct 16, 2023
s3_name = strip_s3_prefix(s3_uri)

if s3_name.endswith("/"):
s3_name = s3_name[:-1]

name, extension = os.path.splitext(s3_name)

if extension != "":
if remove_extension and extension != "":
extension = extension[1:] # remove the dot
return f"urn:li:dataset:(urn:li:dataPlatform:s3,{name}_{extension},{env})"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe instead of underscore it would be better to just URL encode the dot

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general maybe we should url encode the urn parts

s3_name = strip_s3_prefix(s3_uri)

if s3_name.endswith("/"):
s3_name = s3_name[:-1]

name, extension = os.path.splitext(s3_name)

if extension != "":
if remove_extension and extension != "":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if remove_extension and extension != "":
if remove_extension and extension:

@asikowitz asikowitz merged commit 9fec602 into datahub-project:master Oct 17, 2023
51 of 53 checks passed
@asikowitz asikowitz deleted the unity-catalog-external-lineage branch October 17, 2023 13:58
@maggiehays maggiehays added the hacktoberfest-accepted Acceptance for hacktoberfest https://hacktoberfest.com/participation/ label Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Acceptance for hacktoberfest https://hacktoberfest.com/participation/ ingestion PR or Issue related to the ingestion of metadata
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants