Skip to content

Commit 7833cbb

Browse files
move the internal stage check inside transfer_accelerate_config to allow the previous checks to complete
1 parent 45231f8 commit 7833cbb

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/snowflake/connector/s3_storage_client.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,6 @@ def __init__(
8282
self.stage_info["location"]
8383
)
8484
)
85-
if str(self.s3location.bucket_name).lower().startswith("sfc-"):
86-
# SNOW-2324060: no s3:GetAccelerateConfiguration and no intention to add either
87-
# for internal stage, thus previously the client got HTTP403 on /accelerate call
88-
logger.debug(
89-
"Not attempting to get bucket transfer accelerate endpoint for internal stage."
90-
)
91-
use_accelerate_endpoint = False
9285
self.use_s3_regional_url = (
9386
use_s3_regional_url
9487
or "useS3RegionalUrl" in stage_info
@@ -127,9 +120,17 @@ def transfer_accelerate_config(
127120
return False
128121
else:
129122
if use_accelerate_endpoint is None:
130-
use_accelerate_endpoint = self._get_bucket_accelerate_config(
131-
self.s3location.bucket_name
132-
)
123+
if str(self.s3location.bucket_name).lower().startswith("sfc-"):
124+
# SNOW-2324060: no s3:GetAccelerateConfiguration and no intention to add either
125+
# for internal stage, thus previously the client got HTTP403 on /accelerate call
126+
logger.debug(
127+
"Not attempting to get bucket transfer accelerate endpoint for internal stage."
128+
)
129+
use_accelerate_endpoint = False
130+
else:
131+
use_accelerate_endpoint = self._get_bucket_accelerate_config(
132+
self.s3location.bucket_name
133+
)
133134

134135
if use_accelerate_endpoint:
135136
self.endpoint = (

0 commit comments

Comments
 (0)