22
33import asyncio
44import math
5- import warnings
65from collections .abc import Iterable
76from queue import Queue
87from typing import TYPE_CHECKING , Any , Literal
@@ -377,8 +376,6 @@ def batch_add_requests(
377376 * ,
378377 forefront : bool = False ,
379378 max_parallel : int = 1 ,
380- max_unprocessed_requests_retries : int | None = None ,
381- min_delay_between_unprocessed_requests_retries : timedelta | None = None ,
382379 timeout : Timeout = 'medium' ,
383380 ) -> BatchAddResult :
384381 """Add requests to the request queue in batches.
@@ -393,26 +390,11 @@ def batch_add_requests(
393390 max_parallel: Specifies the maximum number of parallel tasks for API calls. This is only applicable
394391 to the async client. For the sync client, this value must be set to 1, as parallel execution
395392 is not supported.
396- max_unprocessed_requests_retries: Deprecated argument. Will be removed in next major release.
397- min_delay_between_unprocessed_requests_retries: Deprecated argument. Will be removed in next major release.
398393 timeout: Timeout for the API HTTP request.
399394
400395 Returns:
401396 Result containing lists of processed and unprocessed requests.
402397 """
403- if max_unprocessed_requests_retries :
404- warnings .warn (
405- '`max_unprocessed_requests_retries` is deprecated and not used anymore.' ,
406- DeprecationWarning ,
407- stacklevel = 2 ,
408- )
409- if min_delay_between_unprocessed_requests_retries :
410- warnings .warn (
411- '`min_delay_between_unprocessed_requests_retries` is deprecated and not used anymore.' ,
412- DeprecationWarning ,
413- stacklevel = 2 ,
414- )
415-
416398 if max_parallel != 1 :
417399 raise NotImplementedError ('max_parallel is only supported in async client' )
418400
@@ -514,7 +496,6 @@ def list_requests(
514496 filter : list [Literal ['pending' , 'locked' ]] | None = None , # noqa: A002
515497 timeout : Timeout = 'medium' ,
516498 cursor : str | None = None ,
517- exclusive_start_id : str | None = None ,
518499 ) -> ListOfRequests :
519500 """List requests in the queue.
520501
@@ -525,23 +506,11 @@ def list_requests(
525506 filter: List of request states to use as a filter. Multiple values mean union of the given filters.
526507 timeout: Timeout for the API HTTP request.
527508 cursor: A token returned in previous API response, to continue listing next page of requests
528- exclusive_start_id: (deprecated) All requests up to this one (including) are skipped from the result.
529509 """
530- if exclusive_start_id and cursor :
531- raise ValueError ('Cannot use both `exclusive_start_id` and `cursor` for paginating requests.' )
532-
533- if exclusive_start_id is not None :
534- warnings .warn (
535- '`exclusive_start_id` is deprecated for paginating requests. Use pagination using `cursor` instead.' ,
536- DeprecationWarning ,
537- stacklevel = 2 ,
538- )
539-
540510 request_params = self ._build_params (
541511 limit = limit ,
542512 filter = ',' .join (filter ) if filter else None ,
543513 clientKey = self .client_key ,
544- exclusiveStartId = exclusive_start_id ,
545514 cursor = cursor ,
546515 )
547516
@@ -979,8 +948,6 @@ async def batch_add_requests(
979948 * ,
980949 forefront : bool = False ,
981950 max_parallel : int = 5 ,
982- max_unprocessed_requests_retries : int | None = None ,
983- min_delay_between_unprocessed_requests_retries : timedelta | None = None ,
984951 timeout : Timeout = 'medium' ,
985952 ) -> BatchAddResult :
986953 """Add requests to the request queue in batches.
@@ -995,26 +962,11 @@ async def batch_add_requests(
995962 max_parallel: Specifies the maximum number of parallel tasks for API calls. This is only applicable
996963 to the async client. For the sync client, this value must be set to 1, as parallel execution
997964 is not supported.
998- max_unprocessed_requests_retries: Deprecated argument. Will be removed in next major release.
999- min_delay_between_unprocessed_requests_retries: Deprecated argument. Will be removed in next major release.
1000965 timeout: Timeout for the API HTTP request.
1001966
1002967 Returns:
1003968 Result containing lists of processed and unprocessed requests.
1004969 """
1005- if max_unprocessed_requests_retries :
1006- warnings .warn (
1007- '`max_unprocessed_requests_retries` is deprecated and not used anymore.' ,
1008- DeprecationWarning ,
1009- stacklevel = 2 ,
1010- )
1011- if min_delay_between_unprocessed_requests_retries :
1012- warnings .warn (
1013- '`min_delay_between_unprocessed_requests_retries` is deprecated and not used anymore.' ,
1014- DeprecationWarning ,
1015- stacklevel = 2 ,
1016- )
1017-
1018970 requests_as_dicts = [
1019971 (
1020972 request
@@ -1126,7 +1078,6 @@ async def list_requests(
11261078 filter : list [Literal ['pending' , 'locked' ]] | None = None , # noqa: A002
11271079 timeout : Timeout = 'medium' ,
11281080 cursor : str | None = None ,
1129- exclusive_start_id : str | None = None ,
11301081 ) -> ListOfRequests :
11311082 """List requests in the queue.
11321083
@@ -1137,23 +1088,11 @@ async def list_requests(
11371088 filter: List of request states to use as a filter. Multiple values mean union of the given filters.
11381089 timeout: Timeout for the API HTTP request.
11391090 cursor: A token returned in previous API response, to continue listing next page of requests
1140- exclusive_start_id: (deprecated) All requests up to this one (including) are skipped from the result.
11411091 """
1142- if exclusive_start_id and cursor :
1143- raise ValueError ('Cannot use both `exclusive_start_id` and `cursor` for paginating requests.' )
1144-
1145- if exclusive_start_id is not None :
1146- warnings .warn (
1147- '`exclusive_start_id` is deprecated for paginating requests. Use pagination using `cursor` instead.' ,
1148- DeprecationWarning ,
1149- stacklevel = 2 ,
1150- )
1151-
11521092 request_params = self ._build_params (
11531093 limit = limit ,
11541094 filter = ',' .join (filter ) if filter else None ,
11551095 clientKey = self .client_key ,
1156- exclusiveStartId = exclusive_start_id ,
11571096 cursor = cursor ,
11581097 )
11591098
0 commit comments