@@ -401,7 +401,6 @@ def __init__(
401
401
http_session : Any = None ,
402
402
http_scheme : str = None ,
403
403
auth : Optional [Any ] = constants .DEFAULT_AUTH ,
404
- redirect_handler : Any = None ,
405
404
max_attempts : int = MAX_ATTEMPTS ,
406
405
request_timeout : Union [float , Tuple [float , float ]] = constants .DEFAULT_REQUEST_TIMEOUT ,
407
406
handle_retry = _RetryWithExponentialBackoff (),
@@ -434,7 +433,6 @@ def __init__(
434
433
self ._auth .set_http_session (self ._http_session )
435
434
self ._exceptions += self ._auth .get_exceptions ()
436
435
437
- self ._redirect_handler = redirect_handler
438
436
self ._request_timeout = request_timeout
439
437
self ._handle_retry = handle_retry
440
438
self .max_attempts = max_attempts
@@ -557,22 +555,8 @@ def post(self, sql: str, additional_http_headers: Optional[Dict[str, Any]] = Non
557
555
data = data ,
558
556
headers = http_headers ,
559
557
timeout = self ._request_timeout ,
560
- allow_redirects = self ._redirect_handler is None ,
561
558
proxies = PROXIES ,
562
559
)
563
- if self ._redirect_handler is not None :
564
- while http_response is not None and http_response .is_redirect :
565
- location = http_response .headers ["Location" ]
566
- url = self ._redirect_handler .handle (location )
567
- logger .info ("redirect %s from %s to %s" , http_response .status_code , location , url )
568
- http_response = self ._post (
569
- url ,
570
- data = data ,
571
- headers = http_headers ,
572
- timeout = self ._request_timeout ,
573
- allow_redirects = False ,
574
- proxies = PROXIES ,
575
- )
576
560
return http_response
577
561
578
562
def get (self , url : str ):
0 commit comments