mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-28 02:17:53 +00:00
fix(ingest/snowflake): fix azure cloud region ids in external url (#8376)
Co-authored-by: Harshal Sheth <hsheth2@gmail.com>
This commit is contained in:
parent
ae7e3c2080
commit
a2fc02294c
@ -17,12 +17,25 @@ class SnowflakeEdition(str, Enum):
|
||||
ENTERPRISE = "Enterprise or above"
|
||||
|
||||
|
||||
# See https://docs.snowflake.com/en/user-guide/admin-account-identifier.html#region-ids
|
||||
# See https://docs.snowflake.com/en/user-guide/admin-account-identifier#non-vps-account-locator-formats-by-cloud-platform-and-region
|
||||
# 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_westus2": (SnowflakeCloudProvider.AZURE, "west-us-2"),
|
||||
"azure_centralus": (SnowflakeCloudProvider.AZURE, "central-us"),
|
||||
"azure_southcentralus": (SnowflakeCloudProvider.AZURE, "south-central-us"),
|
||||
"azure_eastus2": (SnowflakeCloudProvider.AZURE, "east-us-2"),
|
||||
"azure_usgovvirginia": (SnowflakeCloudProvider.AZURE, "us-gov-virginia"),
|
||||
"azure_canadacentral": (SnowflakeCloudProvider.AZURE, "canada-central"),
|
||||
"azure_uksouth": (SnowflakeCloudProvider.AZURE, "uk-south"),
|
||||
"azure_centralindia": (SnowflakeCloudProvider.AZURE, "central-india.azure"),
|
||||
"azure_northeurope": (SnowflakeCloudProvider.AZURE, "north-europe"),
|
||||
"azure_westeurope": (SnowflakeCloudProvider.AZURE, "west-europe"),
|
||||
"azure_switzerlandnorth": (SnowflakeCloudProvider.AZURE, "switzerland-north"),
|
||||
"azure_uaenorth": (SnowflakeCloudProvider.AZURE, "uae-north"),
|
||||
"azure_centralindia": (SnowflakeCloudProvider.AZURE, "central-india"),
|
||||
"azure_japaneast": (SnowflakeCloudProvider.AZURE, "japan-east"),
|
||||
"azure_southeastasia": (SnowflakeCloudProvider.AZURE, "southeast-asia"),
|
||||
"azure_australiaeast": (SnowflakeCloudProvider.AZURE, "australia-east"),
|
||||
}
|
||||
|
||||
# https://docs.snowflake.com/en/sql-reference/snowflake-db.html
|
||||
|
||||
@ -593,7 +593,7 @@ def test_azure_cloud_region_from_snowflake_region_id():
|
||||
)
|
||||
|
||||
assert cloud == SnowflakeCloudProvider.AZURE
|
||||
assert cloud_region_id == "switzerlandnorth"
|
||||
assert cloud_region_id == "switzerland-north"
|
||||
|
||||
(
|
||||
cloud,
|
||||
@ -603,7 +603,7 @@ def test_azure_cloud_region_from_snowflake_region_id():
|
||||
)
|
||||
|
||||
assert cloud == SnowflakeCloudProvider.AZURE
|
||||
assert cloud_region_id == "central-india.azure"
|
||||
assert cloud_region_id == "central-india"
|
||||
|
||||
|
||||
def test_unknown_cloud_region_from_snowflake_region_id():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user