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/snowflake): initialize schema resolver from datahub for l… #8903

Conversation

mayurinehate
Copy link
Collaborator

…ineage-only ingestion

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 Sep 26, 2023
def _init_schema_resolver(self) -> SchemaResolver:
if not self.config.include_technical_schema and self.config.parse_view_ddl:
if self.ctx.graph:
return self.ctx.graph.initialize_schema_resolver_from_datahub(
Copy link
Collaborator

Choose a reason for hiding this comment

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

instead of initialize_schema_resolver_from_datahub returning Tuple[SchemaResolver, set[urns]], can we change it so that it only returns SchemaResolver, and in turn SchemaResolver has a method to get a set of loaded urns?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

makes sense. What would we call this method in SchemaResolver ? get_urns ?

@@ -1004,8 +1017,6 @@ def _process_view(
yield from self._process_tag(tag)

yield from self.gen_dataset_workunits(view, schema_name, db_name)
elif self.config.parse_view_ddl:
Copy link
Collaborator

Choose a reason for hiding this comment

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

these changes confuse me a bit - are we dropping parse_view_ddl, or is that functionality handled elsewhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These conditions were part of schema extraction process, such that - even if schema ingestion is disabled but parse_view_ddl is enabled, the code to fetch and generate schema metadata from snowflake would run, in order for that to be used during view definitions cll extraction.

Actual view definition parsing logic is in snowflake_lineage_v2.py and the only thing it requires is view_definitions to be populated. This code is still intact.

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok that broadly makes sense

@mayurinehate mayurinehate force-pushed the master+ing-334-snowflake-initialize-schema-resolver branch from d28b157 to 04ea7cb Compare September 28, 2023 06:40
@hsheth2 hsheth2 added the merge-pending-ci A PR that has passed review and should be merged once CI is green. label Oct 2, 2023
@anshbansal anshbansal merged commit e3780c2 into datahub-project:master Oct 4, 2023
57 checks passed
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 merge-pending-ci A PR that has passed review and should be merged once CI is green.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants