forked from datahub-project/datahub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ingest/snowflake): handle failures gracefully and raise permissi…
…on failures (datahub-project#6748)
- Loading branch information
1 parent
21a9864
commit 276a911
Showing
20 changed files
with
2,398 additions
and
1,167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
metadata-ingestion/src/datahub/ingestion/source/snowflake/constants.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
from enum import Enum | ||
|
||
|
||
class SnowflakeCloudProvider(str, Enum): | ||
AWS = "aws" | ||
GCP = "gcp" | ||
AZURE = "azure" | ||
|
||
|
||
SNOWFLAKE_DEFAULT_CLOUD = SnowflakeCloudProvider.AWS | ||
|
||
|
||
class SnowflakeEdition(str, Enum): | ||
STANDARD = "Standard" | ||
|
||
# We use this to represent Enterprise Edition or higher | ||
ENTERPRISE = "Enterprise or above" | ||
|
||
|
||
# See https://docs.snowflake.com/en/user-guide/admin-account-identifier.html#region-ids | ||
# Includes only exceptions to format <provider>_<cloud region with hyphen replaced by _> | ||
SNOWFLAKE_REGION_CLOUD_REGION_MAPPING = { | ||
"aws_us_east_1_gov": (SnowflakeCloudProvider.AWS, "us-east-1"), | ||
"azure_uksouth": (SnowflakeCloudProvider.AZURE, "uk-south"), | ||
"azure_centralindia": (SnowflakeCloudProvider.AZURE, "central-india.azure"), | ||
} | ||
|
||
# https://docs.snowflake.com/en/sql-reference/snowflake-db.html | ||
SNOWFLAKE_DATABASE = "SNOWFLAKE" | ||
|
||
|
||
# We will always compare with lowercase | ||
# Complete list for objectDomain - https://docs.snowflake.com/en/sql-reference/account-usage/access_history.html | ||
class SnowflakeObjectDomain(str, Enum): | ||
TABLE = "table" | ||
EXTERNAL_TABLE = "external table" | ||
VIEW = "view" | ||
MATERIALIZED_VIEW = "materialized view" | ||
|
||
|
||
GENERIC_PERMISSION_ERROR_KEY = "permission-error" | ||
LINEAGE_PERMISSION_ERROR = "lineage-permission-error" | ||
|
||
|
||
# Snowflake connection arguments | ||
# https://docs.snowflake.com/en/user-guide/python-connector-api.html#connect | ||
CLIENT_PREFETCH_THREADS = "client_prefetch_threads" | ||
CLIENT_SESSION_KEEP_ALIVE = "client_session_keep_alive" |
Oops, something went wrong.