Skip to content

Commit 89eecda

Browse files
SNOW-1258702:SnowSQL File Upload support for China (#1932)
1 parent 5dc3c47 commit 89eecda

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

DESCRIPTION.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ Source code is also available at: https://github.com/snowflakedb/snowflake-conne
99
# Release Notes
1010

1111
- v3.10.0 (TBD)
12-
- Added support for structured types to fetch_pandas_all
12+
- Added support for structured types to fetch_pandas_all.
13+
- Fixed an issue that endpoint for China s3 is not formed correctly.
1314

1415
- v3.9.1(April 22,2024)
1516

src/snowflake/connector/s3_storage_client.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,11 @@ def transfer_accelerate_config(
9494
self, use_accelerate_endpoint: bool | None = None
9595
) -> bool:
9696
# accelerate cannot be used in China and us government
97-
if (self.location_type and "S3China".lower() in self.location_type.lower()) or (
98-
self.region_name and self.region_name.startswith("cn-")
99-
):
97+
if self.region_name and self.region_name.startswith("cn-"):
98+
self.endpoint = (
99+
f"https://{self.s3location.bucket_name}."
100+
f"s3.{self.region_name}.amazonaws.com.cn"
101+
)
100102
return False
101103
# if self.endpoint has been set, e.g. by metadata, no more config is needed.
102104
if self.endpoint is not None:

0 commit comments

Comments
 (0)