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

refactor(ingest): Refactoring container creation to common place #6877

Merged
merged 49 commits into from
Jan 20, 2023

Conversation

treff7es
Copy link
Contributor

Refactoring container creation to common place
Using auto-state handler in bigquery, sql-common and snowflake

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

Using auto-state handler in bigquery, sql-common and snowflake
@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Dec 28, 2022
platform=self.platform,
domain_config=self.config.domain,
domain_registry=self.domain_registry,
platform_instance=self.config.platform_instance,
Copy link
Collaborator

Choose a reason for hiding this comment

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

platform, platform_instance, env, and probably even database should all already be in the database_container_key - can we simplify these calls?

dataset,
["Dataset"],
database_container_key,
yield from gen_schema_containers(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
yield from gen_schema_containers(
yield from gen_schema_container(

# Conflicts:
#	metadata-ingestion/src/datahub/ingestion/source/bigquery_v2/bigquery.py
#	metadata-ingestion/src/datahub/ingestion/source/snowflake/snowflake_v2.py
#	metadata-ingestion/src/datahub/ingestion/source/sql/presto_on_hive.py
#	metadata-ingestion/src/datahub/ingestion/source/sql/sql_common.py
# Conflicts:
#	metadata-ingestion/src/datahub/ingestion/source/sql/sql_common.py
@treff7es treff7es closed this Jan 19, 2023
@treff7es treff7es reopened this Jan 19, 2023
if not env:
env = config.env

schema_container_key = (
Copy link
Collaborator

Choose a reason for hiding this comment

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

always overrides schema_container_key - probably not what we want

assert platform

if not platform_instance:
platform_instance = config.platform_instance
Copy link
Collaborator

Choose a reason for hiding this comment

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

ideally remove platform, platform_instance, and env options - pull from the key_container instead

@@ -1299,40 +1212,18 @@ def gen_database_containers(
else None,
)

self.stale_entity_removal_handler.add_entity_to_state(
Copy link
Collaborator

Choose a reason for hiding this comment

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

make sure to remove these in other places too

@treff7es treff7es requested a review from hsheth2 January 20, 2023 12:34
name=schema.name,
description=schema.comment,
schema=self.snowflake_identifier(schema.name),
database=self.snowflake_identifier(db_name),
Copy link
Collaborator

Choose a reason for hiding this comment

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

still feels a bit annoying that we need to provide the name twice, but i guess we can fix in a later PR

@treff7es treff7es merged commit 0cdb5e4 into datahub-project:master Jan 20, 2023
ericyomi pushed a commit to ericyomi/datahub that referenced this pull request Feb 8, 2023
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