diff --git a/DESCRIPTION.md b/DESCRIPTION.md index 42bb6d37c..dfe0c8030 100644 --- a/DESCRIPTION.md +++ b/DESCRIPTION.md @@ -9,7 +9,8 @@ Source code is also available at: https://github.com/snowflakedb/snowflake-conne # Release Notes - v3.10.0 (TBD) - - Added support for structured types to fetch_pandas_all + - Added support for structured types to fetch_pandas_all. + - Fixed an issue that endpoint for China s3 is not formed correctly. - v3.9.1(April 22,2024) diff --git a/src/snowflake/connector/s3_storage_client.py b/src/snowflake/connector/s3_storage_client.py index 9c3ab8075..673134081 100644 --- a/src/snowflake/connector/s3_storage_client.py +++ b/src/snowflake/connector/s3_storage_client.py @@ -94,9 +94,11 @@ def transfer_accelerate_config( self, use_accelerate_endpoint: bool | None = None ) -> bool: # accelerate cannot be used in China and us government - if (self.location_type and "S3China".lower() in self.location_type.lower()) or ( - self.region_name and self.region_name.startswith("cn-") - ): + if self.region_name and self.region_name.startswith("cn-"): + self.endpoint = ( + f"https://{self.s3location.bucket_name}." + f"s3.{self.region_name}.amazonaws.com.cn" + ) return False # if self.endpoint has been set, e.g. by metadata, no more config is needed. if self.endpoint is not None: