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:
Mayuri Nehate 2023-07-12 17:11:33 +05:30 committed by GitHub
parent ae7e3c2080
commit a2fc02294c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 4 deletions

View File

@ -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

View File

@ -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():