@@ -401,7 +401,6 @@ def __init__(
401401 http_session : Any = None ,
402402 http_scheme : str = None ,
403403 auth : Optional [Any ] = constants .DEFAULT_AUTH ,
404- redirect_handler : Any = None ,
405404 max_attempts : int = MAX_ATTEMPTS ,
406405 request_timeout : Union [float , Tuple [float , float ]] = constants .DEFAULT_REQUEST_TIMEOUT ,
407406 handle_retry = _RetryWithExponentialBackoff (),
@@ -434,7 +433,6 @@ def __init__(
434433 self ._auth .set_http_session (self ._http_session )
435434 self ._exceptions += self ._auth .get_exceptions ()
436435
437- self ._redirect_handler = redirect_handler
438436 self ._request_timeout = request_timeout
439437 self ._handle_retry = handle_retry
440438 self .max_attempts = max_attempts
@@ -557,22 +555,8 @@ def post(self, sql: str, additional_http_headers: Optional[Dict[str, Any]] = Non
557555 data = data ,
558556 headers = http_headers ,
559557 timeout = self ._request_timeout ,
560- allow_redirects = self ._redirect_handler is None ,
561558 proxies = PROXIES ,
562559 )
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- )
576560 return http_response
577561
578562 def get (self , url : str ):
0 commit comments