29
29
from databento .common import API_VERSION
30
30
from databento .common .constants import HTTP_STREAMING_READ_SIZE
31
31
from databento .common .enums import Delivery
32
+ from databento .common .enums import JobState
32
33
from databento .common .enums import SplitDuration
33
34
from databento .common .error import BentoError
34
35
from databento .common .error import BentoHttpError
37
38
from databento .common .http import check_http_error
38
39
from databento .common .parsing import datetime_to_string
39
40
from databento .common .parsing import optional_datetime_to_string
40
- from databento .common .parsing import optional_values_list_to_string
41
+ from databento .common .parsing import optional_states_list_to_string
41
42
from databento .common .parsing import symbols_list_to_list
42
43
from databento .common .publishers import Dataset
43
44
from databento .common .validation import validate_enum
@@ -185,7 +186,7 @@ def submit_job(
185
186
186
187
def list_jobs (
187
188
self ,
188
- states : Iterable [str ] | str = "received, queued,processing,done" ,
189
+ states : Iterable [JobState | str ] | JobState | str | None = "queued,processing,done" ,
189
190
since : pd .Timestamp | datetime | date | str | int | None = None ,
190
191
) -> list [dict [str , Any ]]:
191
192
"""
@@ -197,8 +198,9 @@ def list_jobs(
197
198
198
199
Parameters
199
200
----------
200
- states : Iterable[str] or str, optional {'received', 'queued', 'processing', 'done', 'expired'} # noqa
201
+ states : Iterable[JobState | str] or JobState or str, optional {'queued', 'processing', 'done', 'expired'} # noqa
201
202
The filter for jobs states as an iterable of comma separated values.
203
+ Defaults to all except 'expired'.
202
204
since : pd.Timestamp, datetime, date, str, or int, optional
203
205
The filter for timestamp submitted (will not include jobs prior to this).
204
206
@@ -209,7 +211,7 @@ def list_jobs(
209
211
210
212
"""
211
213
params : list [tuple [str , str | None ]] = [
212
- ("states" , optional_values_list_to_string (states )),
214
+ ("states" , optional_states_list_to_string (states )),
213
215
("since" , optional_datetime_to_string (since )),
214
216
]
215
217
0 commit comments