@@ -38,6 +38,7 @@ def __init__(
38
38
cnx : SnowflakeConnection ,
39
39
command : str ,
40
40
unsafe_file_write : bool = False ,
41
+ use_virtual_endpoints : bool = False ,
41
42
) -> None :
42
43
"""Creates a client object with given stage credentials.
43
44
@@ -72,6 +73,7 @@ def __init__(
72
73
self .endpoint : str | None = (
73
74
None if "endPoint" not in stage_info else stage_info ["endPoint" ]
74
75
)
76
+ self .use_virtual_endpoints : bool = use_virtual_endpoints
75
77
76
78
async def _has_expired_token (self , response : aiohttp .ClientResponse ) -> bool :
77
79
return self .security_token and response .status == 401
@@ -147,6 +149,8 @@ def generate_url_and_rest_args() -> (
147
149
if "region" not in self .stage_info
148
150
else self .stage_info ["region" ]
149
151
),
152
+ self .endpoint ,
153
+ self .use_virtual_endpoints ,
150
154
)
151
155
access_token = self .security_token
152
156
else :
@@ -185,6 +189,7 @@ def generate_url_and_rest_args() -> (
185
189
else self .stage_info ["region" ]
186
190
),
187
191
self .endpoint ,
192
+ self .use_virtual_endpoints ,
188
193
)
189
194
access_token = self .security_token
190
195
gcs_headers ["Authorization" ] = f"Bearer { access_token } "
@@ -309,6 +314,8 @@ def generate_url_and_authenticated_headers():
309
314
if "region" not in self .stage_info
310
315
else self .stage_info ["region" ]
311
316
),
317
+ self .endpoint ,
318
+ self .use_virtual_endpoints ,
312
319
)
313
320
gcs_headers = {"Authorization" : f"Bearer { self .security_token } " }
314
321
rest_args = {"headers" : gcs_headers }
0 commit comments