-
Notifications
You must be signed in to change notification settings - Fork 39
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: added labels and tags fetching for BigQuery #93
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM already, @manuelzander. Thanks for tackling this. :) Let me know when it's ready to come out of Draft, and I'll run my own local tests and merge.
if "tags" in tags_dict: | ||
for tag in tags_dict["tags"]: | ||
if not "column" in tag: | ||
table_tag = tag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh. I didn't know you could do not x in y
. I always write it x not in y
. Learning something new every day :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could change it to make it clearer for everybody :)
def test_table_part_of_table_date_range(self, mock_build): | ||
mock_build.return_value = MockBigQueryClient( | ||
@patch("whale.extractor.base_bigquery_extractor.datacatalog_v1") | ||
def test_table_part_of_table_date_range(self, mock_datacatalogue, mock_bigquery): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BRITISH ENGLISH!? UNACCEPTABLE!
Just kidding, please don't change it. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh haha my bad, I mixed it up 😂 Google style...
@rsyi Are you happy with labels being stored as |
Yeah I was wondering about this too, but it seemed like bigquery tags are more like weird, nested json annotations than they are plain string tags, so we can't just throw away everything but the field names... I think this is fine for now. Another option (though a bit more work) could be to create a separate |
@rsyi I've just added an additional test (no tags for a given BQ table). |
datacatalog_v1
Python client to fetch tags for a given BQ tableTableMetadata
andColumnMetadata
where appropriateTableMetadata