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): Respect dataset and table patterns when ingesting lineage via catalog api #10080

Conversation

ANich
Copy link
Contributor

@ANich ANich commented Mar 19, 2024

Similar to when ingesting lineage via GCP audit logs:

if not is_schema_allowed(
self.config.dataset_pattern,
destination_table.table_identifier.dataset,
destination_table.table_identifier.project_id,
self.config.match_fully_qualified_names,
) or not self.config.table_pattern.allowed(
destination_table.table_identifier.get_table_name()
):
self.report.num_skipped_lineage_entries_not_allowed[e.project_id] += 1
continue

Currently, when using extract_lineage_from_catalog=True a request is issued for every table in the project.

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 ingestion PR or Issue related to the ingestion of metadata community-contribution PR or Issue raised by member(s) of DataHub Community labels Mar 19, 2024
@ANich ANich marked this pull request as ready for review March 19, 2024 19:34
schema_name=project_table.dataset_id,
db_name=project_table.project,
match_fully_qualified_schema_name=self.config.match_fully_qualified_names,
) or not self.config.table_pattern.allowed(project_table.table_id):
Copy link
Collaborator

Choose a reason for hiding this comment

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

self.config.table_pattern needs to be checked against qualified table name <project>.<dataset>.<table> . I would suggest moving the table variable definition
table = f"{project_table.project}.{project_table.dataset_id}.{project_table.table_id}"
before if condition and using it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, I didn't notice that table patterns expected qualified names. I'll have to update my own recipes as well. Updated in 5cbb1b1

Copy link
Collaborator

@mayurinehate mayurinehate left a comment

Choose a reason for hiding this comment

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

LGTM

@hsheth2 hsheth2 merged commit e4ebf34 into datahub-project:master Mar 26, 2024
53 checks passed
@ANich ANich deleted the feat/ingest_bigquery_respect_patterns_catalog_api branch March 26, 2024 17:12
sleeperdeep pushed a commit to sleeperdeep/datahub that referenced this pull request Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution PR or Issue raised by member(s) of DataHub Community ingestion PR or Issue related to the ingestion of metadata
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants