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/bigquery): Add way to reference existing DataHub Tag from a bigquery label #11544

Merged
merged 6 commits into from
Oct 9, 2024

Conversation

treff7es
Copy link
Contributor

@treff7es treff7es commented Oct 7, 2024

Add a way to reference existing DataHub Tag from a BigQuery label.

When we sync from DataHub to BigQuery, we encode the tags as modified base32 strings.
BiqQuery labels only support lowercase letters, international characters, numbers, or underscores.
So, we need to modify the base32 encoding to replace the padding character = with _ and convert it to lowercase.

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 7, 2024
@treff7es treff7es force-pushed the bq_encoded_tag_ingestion branch from 6baabc6 to f6ac8e7 Compare October 7, 2024 11:28
fix linter error
@@ -708,6 +722,8 @@ def gen_table_dataset_workunits(
tags_to_add.extend(
[
make_tag_urn(f"""{k}:{v}""")
if not v.startswith(ENCODED_TAG_PREFIX)
else self.modified_base32decode(v)
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's pull this out into a make_tag_from_label(k, v) helper method, and ideally add some tests for that helper

@treff7es treff7es merged commit 3cb1678 into datahub-project:master Oct 9, 2024
72 checks passed
sleeperdeep pushed a commit to sleeperdeep/datahub that referenced this pull request Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ingestion PR or Issue related to the ingestion of metadata
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants