@@ -160,6 +160,7 @@ def read(self) -> Optional[OAuthToken]:
160
160
STRUCT is returned as Dict[str, Any]
161
161
ARRAY is returned as numpy.ndarray
162
162
When False, complex types are returned as a strings. These are generally deserializable as JSON.
163
+ :param proxies: An optional dictionary mapping protocol to the URL of the proxy.
163
164
"""
164
165
165
166
# Internal arguments in **kwargs:
@@ -208,6 +209,7 @@ def read(self) -> Optional[OAuthToken]:
208
209
self .port = kwargs .get ("_port" , 443 )
209
210
self .disable_pandas = kwargs .get ("_disable_pandas" , False )
210
211
self .lz4_compression = kwargs .get ("enable_query_result_lz4_compression" , True )
212
+ self .proxies = kwargs .get ("proxies" )
211
213
212
214
auth_provider = get_python_sql_connector_auth_provider (
213
215
server_hostname , ** kwargs
@@ -648,7 +650,7 @@ def _handle_staging_put(
648
650
raise Error ("Cannot perform PUT without specifying a local_file" )
649
651
650
652
with open (local_file , "rb" ) as fh :
651
- r = requests .put (url = presigned_url , data = fh , headers = headers )
653
+ r = requests .put (url = presigned_url , data = fh , headers = headers , proxies = self . connection . proxies )
652
654
653
655
# fmt: off
654
656
# Design borrowed from: https://stackoverflow.com/a/2342589/5093960
@@ -682,7 +684,7 @@ def _handle_staging_get(
682
684
if local_file is None :
683
685
raise Error ("Cannot perform GET without specifying a local_file" )
684
686
685
- r = requests .get (url = presigned_url , headers = headers )
687
+ r = requests .get (url = presigned_url , headers = headers , proxies = self . connection . proxies )
686
688
687
689
# response.ok verifies the status code is not between 400-600.
688
690
# Any 2xx or 3xx will evaluate r.ok == True
@@ -697,7 +699,7 @@ def _handle_staging_get(
697
699
def _handle_staging_remove (self , presigned_url : str , headers : dict = None ):
698
700
"""Make an HTTP DELETE request to the presigned_url"""
699
701
700
- r = requests .delete (url = presigned_url , headers = headers )
702
+ r = requests .delete (url = presigned_url , headers = headers , proxies = self . connection . proxies )
701
703
702
704
if not r .ok :
703
705
raise Error (
0 commit comments