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

Add Snowflake ingestion config options: allow_empty_schemas, skip_standard_edition_check #12841

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ source:
# This option is recommended to reduce profiling time and costs.
turn_off_expensive_profiling_metrics: true

# If set to True, assumes this is Datahub Enterprise Edition, and skips the check for standard edition. Default is False.
skip_standard_edition_check: True

# If set to True, allows schemas with no tables or views to be processed, without reporting generic permissions error. Default is False.
allow_empty_schemas: True

# (Optional) Uncomment and update this section to filter profiled tables
# profile_pattern:
# allow:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,16 @@ class SnowflakeV2Config(
" Map of share name -> details of share.",
)

skip_standard_edition_check: bool = Field(
default=False,
description="If set to True, assumes this is Datahub Enterprise Edition, and skips the check for standard edition.",
)

allow_empty_schemas: bool = Field(
default=False,
description="If set to True, allows schemas with no tables or views to be processed, without reporting generic permissions error.",
)

include_assertion_results: bool = Field(
default=False,
description="Whether to ingest assertion run results for assertions created using Datahub"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -550,10 +550,11 @@ def get_workunits_internal(self) -> Iterable[MetadataWorkUnit]:
len(discovered_tables) == 0
and len(discovered_views) == 0
and len(discovered_streams) == 0
and not self.config.allow_empty_schemas
):
self.structured_reporter.failure(
GENERIC_PERMISSION_ERROR_KEY,
"No tables/views/streams found. Please check permissions.",
"No tables/views found and allow_empty_schemas is false. Please check permissions.",
)
return

Expand Down Expand Up @@ -732,6 +733,8 @@ def get_snowsight_url_builder(self) -> Optional[SnowsightUrlBuilder]:
return None

def is_standard_edition(self) -> bool:
if self.config.skip_standard_edition_check:
return False
try:
self.connection.query(SnowflakeQuery.show_tags())
return False
Expand Down
Loading