@@ -478,57 +478,6 @@ def _request(
478478 stream_cls = stream_cls ,
479479 )
480480
481- def _request_without_retry (self ,
482- * ,
483- cast_to : Type [ResponseT ],
484- options : RequestOptions ,
485- stream : bool ,
486- stream_cls : type [_StreamT ] | None ,
487- ) -> ResponseT | _StreamT :
488- request = self ._build_request (options )
489- req_id = request .headers .get (CLIENT_REQUEST_HEADER , "" )
490- try :
491- response = self ._client .send (
492- request ,
493- stream = stream or self ._should_stream_response_body (request = request ),
494- )
495- except httpx .TimeoutException as err :
496- log .debug ("Raising timeout error" )
497- raise ArkAPITimeoutError (request = request , request_id = req_id ) from err
498- except Exception as err :
499- log .debug ("Encountered Exception" , exc_info = True )
500- log .debug ("Raising connection error" )
501- raise ArkAPIConnectionError (request = request , request_id = req_id ) from err
502-
503- log .debug (
504- 'HTTP Request: %s %s "%i %s"' ,
505- request .method ,
506- request .url ,
507- response .status_code ,
508- response .reason_phrase ,
509- )
510-
511- try :
512- response .raise_for_status ()
513- except httpx .HTTPStatusError as err : # thrown on 4xx and 5xx status code
514- log .debug ("Encountered httpx.HTTPStatusError" , exc_info = True )
515- # If the response is streamed then we need to explicitly read the response
516- # to completion before attempting to access the response text.
517- if not err .response .is_closed :
518- err .response .read ()
519-
520- log .debug ("Re-raising status error" )
521- raise self ._make_status_error_from_response (
522- err .response , request_id = req_id
523- ) from None
524-
525- return self ._process_response (
526- cast_to = cast_to ,
527- response = response ,
528- stream = stream ,
529- stream_cls = stream_cls ,
530- )
531-
532481 def _retry_request (
533482 self ,
534483 options : RequestOptions ,
@@ -665,7 +614,7 @@ def post_without_retry(
665614 )
666615
667616 return cast (
668- ResponseT , self .request_without_retry (cast_to , opts , stream = stream , stream_cls = stream_cls )
617+ ResponseT , self .request (cast_to , opts , remaining_retries = 0 , stream = stream , stream_cls = stream_cls )
669618 )
670619
671620 def request (
@@ -685,21 +634,6 @@ def request(
685634 remaining_retries = remaining_retries ,
686635 )
687636
688- def request_without_retry (
689- self ,
690- cast_to : Type [ResponseT ],
691- options : RequestOptions ,
692- * ,
693- stream : bool = False ,
694- stream_cls : type [_StreamT ] | None = None ,
695- ) -> ResponseT | _StreamT :
696- return self ._request_without_retry (
697- cast_to = cast_to ,
698- options = options ,
699- stream = stream ,
700- stream_cls = stream_cls ,
701- )
702-
703637 def is_closed (self ) -> bool :
704638 return self ._client .is_closed
705639
@@ -861,7 +795,7 @@ async def post_without_retry(
861795 ** options ,
862796 )
863797
864- return await self .request_without_retry (cast_to , opts , stream = stream , stream_cls = stream_cls )
798+ return await self .request (cast_to , opts , remaining_retries = 0 , stream = stream , stream_cls = stream_cls )
865799
866800 async def request (
867801 self ,
@@ -880,21 +814,6 @@ async def request(
880814 remaining_retries = remaining_retries ,
881815 )
882816
883- async def request_without_retry (
884- self ,
885- cast_to : Type [ResponseT ],
886- options : RequestOptions ,
887- * ,
888- stream : bool = False ,
889- stream_cls : type [_StreamT ] | None = None ,
890- ) -> ResponseT | _StreamT :
891- return await self ._request_without_retry (
892- cast_to = cast_to ,
893- options = options ,
894- stream = stream ,
895- stream_cls = stream_cls ,
896- )
897-
898817 async def _request (
899818 self ,
900819 * ,
@@ -982,57 +901,6 @@ async def _request(
982901 stream_cls = stream_cls ,
983902 )
984903
985- async def _request_without_retry (
986- self ,
987- * ,
988- cast_to : Type [ResponseT ],
989- options : RequestOptions ,
990- stream : bool ,
991- stream_cls : type [_AsyncStreamT ] | None ,
992- ) -> ResponseT | _AsyncStreamT :
993- request = self ._build_request (options )
994- req_id = request .headers .get (CLIENT_REQUEST_HEADER , "" )
995- try :
996- response = await self ._client .send (
997- request ,
998- stream = stream or self ._should_stream_response_body (request = request ),
999- )
1000- except httpx .TimeoutException as err :
1001- log .debug ("Raising timeout error" )
1002- raise ArkAPITimeoutError (request = request , request_id = req_id ) from err
1003- except Exception as err :
1004- log .debug ("Encountered Exception" , exc_info = True )
1005- log .debug ("Raising connection error" )
1006- raise ArkAPIConnectionError (request = request , request_id = req_id ) from err
1007- log .debug (
1008- 'HTTP Request: %s %s "%i %s"' ,
1009- request .method ,
1010- request .url ,
1011- response .status_code ,
1012- response .reason_phrase ,
1013- )
1014- try :
1015- response .raise_for_status ()
1016- except httpx .HTTPStatusError as err : # thrown on 4xx and 5xx status code
1017- log .debug ("Encountered httpx.HTTPStatusError" , exc_info = True )
1018-
1019- # If the response is streamed then we need to explicitly read the response
1020- # to completion before attempting to access the response text.
1021- if not err .response .is_closed :
1022- await err .response .aread ()
1023-
1024- log .debug ("Re-raising status error" )
1025- raise self ._make_status_error_from_response (
1026- err .response , request_id = req_id
1027- ) from None
1028-
1029- return await self ._process_response (
1030- cast_to = cast_to ,
1031- response = response ,
1032- stream = stream ,
1033- stream_cls = stream_cls ,
1034- )
1035-
1036904 async def _retry_request (
1037905 self ,
1038906 options : RequestOptions ,
0 commit comments