Skip to content

Commit 8e81195

Browse files
authored
VER: Release 0.61.0
See release notes.
2 parents d94d864 + 611d773 commit 8e81195

File tree

8 files changed

+76
-12
lines changed

8 files changed

+76
-12
lines changed

CHANGELOG.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## 0.61.0 - 2025-08-12
4+
5+
#### Breaking changes
6+
- Modified the `states` parameter in `batch.list_jobs()`
7+
8+
#### Enhancements
9+
- Added `JobState` enum
10+
- Added export of `SystemCode` and `ErrorCode` from `databento_dbn` to the root `databento` package
11+
- Added `F_PUBLISHER_SPECIFIC` flag to `RecordFlags` enum
12+
13+
#### Bug fixes
14+
- Bumped the minimum version requirement for `requests` to 0.27.0
15+
316
## 0.60.0 - 2025-08-05
417

518
#### Enhancements
@@ -50,8 +63,8 @@ Python
5063
- "ICE Futures Europe (Financials)" renamed to "ICE Europe Financials"
5164
- "ICE Futures Europe (Commodities)" renamed to "ICE Europe Commodities"
5265
- Upgraded `databento-dbn` to 0.36.1
53-
- Fixed setting of ts_out property of DbnFsm based on decoded metadata. This
54-
was preventing ts_out from being correctly decoded in the Python DBNDecoder
66+
- Fixed setting of `ts_out` property of DbnFsm based on decoded metadata. This
67+
was preventing `ts_out` from being correctly decoded in the Python DBNDecoder
5568
- Fixed decoding of `ts_out` with first records in DBNDecoder
5669

5770
#### Bug fixes

databento/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from databento_dbn import Compression
1414
from databento_dbn import ConsolidatedBidAskPair
1515
from databento_dbn import Encoding
16+
from databento_dbn import ErrorCode
1617
from databento_dbn import ErrorMsg
1718
from databento_dbn import ImbalanceMsg
1819
from databento_dbn import InstrumentClass
@@ -35,6 +36,7 @@
3536
from databento_dbn import StatusReason
3637
from databento_dbn import SType
3738
from databento_dbn import SymbolMappingMsg
39+
from databento_dbn import SystemCode
3840
from databento_dbn import SystemMsg
3941
from databento_dbn import TradeMsg
4042
from databento_dbn import TradingEvent
@@ -55,6 +57,7 @@
5557
from databento.common.enums import Delivery
5658
from databento.common.enums import FeedMode
5759
from databento.common.enums import HistoricalGateway
60+
from databento.common.enums import JobState
5861
from databento.common.enums import Packaging
5962
from databento.common.enums import ReconnectPolicy
6063
from databento.common.enums import RecordFlags
@@ -102,6 +105,7 @@
102105
"Dataset",
103106
"Delivery",
104107
"Encoding",
108+
"ErrorCode",
105109
"ErrorMsg",
106110
"FeedMode",
107111
"Historical",
@@ -110,6 +114,7 @@
110114
"InstrumentClass",
111115
"InstrumentDefMsg",
112116
"InstrumentMap",
117+
"JobState",
113118
"Live",
114119
"MBOMsg",
115120
"MBP1Msg",
@@ -137,6 +142,7 @@
137142
"StatusReason",
138143
"SymbolMappingMsg",
139144
"SymbologyResolution",
145+
"SystemCode",
140146
"SystemMsg",
141147
"TBBOMsg",
142148
"TBBOMsg",

databento/common/enums.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def coercible(enum_type: type[M]) -> type[M]:
2828
Parameters
2929
----------
3030
enum_type : EnumMeta
31-
The deocrated Enum type.
31+
The decorated Enum type.
3232
3333
Returns
3434
-------
@@ -167,7 +167,7 @@ class RollRule(StringyMixin, str, Enum):
167167
"""
168168

169169
VOLUME = "volume"
170-
OPEN_INTEREST = "open_interst"
170+
OPEN_INTEREST = "open_interest"
171171
CALENDAR = "calendar"
172172

173173

@@ -207,6 +207,8 @@ class RecordFlags(StringyMixin, IntFlag): # type: ignore
207207
The `ts_recv` value is inaccurate (clock issues or reordering).
208208
F_MAYBE_BAD_BOOK
209209
Indicates an unrecoverable gap was detected in the channel.
210+
F_PUBLISHER_SPECIFIC
211+
Indicates a publisher-specific event.
210212
211213
Other bits are reserved and have no current meaning.
212214
@@ -218,6 +220,7 @@ class RecordFlags(StringyMixin, IntFlag): # type: ignore
218220
F_MBP = 16
219221
F_BAD_TS_RECV = 8
220222
F_MAYBE_BAD_BOOK = 4
223+
F_PUBLISHER_SPECIFIC = 2
221224

222225

223226
@unique
@@ -241,3 +244,16 @@ class PriceType(StringyMixin, str, Enum):
241244
FIXED = "fixed"
242245
FLOAT = "float"
243246
DECIMAL = "decimal"
247+
248+
249+
@unique
250+
@coercible
251+
class JobState(StringyMixin, str, Enum):
252+
"""
253+
Represents the different states for batch jobs.
254+
"""
255+
256+
QUEUED = "queued"
257+
PROCESSING = "processing"
258+
DONE = "done"
259+
EXPIRED = "expired"

databento/common/parsing.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
from databento_dbn import SType
1818

1919
from databento.common.constants import ALL_SYMBOLS
20+
from databento.common.enums import JobState
21+
from databento.common.validation import validate_enum
2022
from databento.common.validation import validate_smart_symbol
2123

2224

@@ -64,6 +66,31 @@ def optional_values_list_to_string(
6466
return values_list_to_string(values)
6567

6668

69+
def optional_states_list_to_string(
70+
states: Iterable[JobState | str] | JobState | str | None,
71+
) -> str | None:
72+
"""
73+
Concatenate a states string or iterable of string states (if not None).
74+
75+
Parameters
76+
----------
77+
states : Iterable[JobState | str] | JobState | str | None
78+
The states to concatenate.
79+
80+
Returns
81+
-------
82+
str or `None`
83+
84+
"""
85+
if states is None:
86+
return None
87+
elif isinstance(states, (JobState, str)):
88+
return str(states)
89+
else:
90+
states_list = [validate_enum(state, JobState, "state").value for state in states]
91+
return ",".join(states_list)
92+
93+
6794
def optional_string_to_list(
6895
value: Iterable[str] | str | None,
6996
) -> Iterable[str] | list[str] | None:

databento/historical/api/batch.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
from databento.common import API_VERSION
3030
from databento.common.constants import HTTP_STREAMING_READ_SIZE
3131
from databento.common.enums import Delivery
32+
from databento.common.enums import JobState
3233
from databento.common.enums import SplitDuration
3334
from databento.common.error import BentoError
3435
from databento.common.error import BentoHttpError
@@ -37,7 +38,7 @@
3738
from databento.common.http import check_http_error
3839
from databento.common.parsing import datetime_to_string
3940
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
4142
from databento.common.parsing import symbols_list_to_list
4243
from databento.common.publishers import Dataset
4344
from databento.common.validation import validate_enum
@@ -185,7 +186,7 @@ def submit_job(
185186

186187
def list_jobs(
187188
self,
188-
states: Iterable[str] | str = "received,queued,processing,done",
189+
states: Iterable[JobState | str] | JobState | str | None = "queued,processing,done",
189190
since: pd.Timestamp | datetime | date | str | int | None = None,
190191
) -> list[dict[str, Any]]:
191192
"""
@@ -197,8 +198,9 @@ def list_jobs(
197198
198199
Parameters
199200
----------
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
201202
The filter for jobs states as an iterable of comma separated values.
203+
Defaults to all except 'expired'.
202204
since : pd.Timestamp, datetime, date, str, or int, optional
203205
The filter for timestamp submitted (will not include jobs prior to this).
204206
@@ -209,7 +211,7 @@ def list_jobs(
209211
210212
"""
211213
params: list[tuple[str, str | None]] = [
212-
("states", optional_values_list_to_string(states)),
214+
("states", optional_states_list_to_string(states)),
213215
("since", optional_datetime_to_string(since)),
214216
]
215217

databento/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.60.0"
1+
__version__ = "0.61.0"

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "databento"
3-
version = "0.60.0"
3+
version = "0.61.0"
44
description = "Official Python client library for Databento"
55
authors = [
66
"Databento <[email protected]>",
@@ -40,7 +40,7 @@ numpy = [
4040
pandas = ">=1.5.3"
4141
pip-system-certs = {version=">=4.0", markers="platform_system == 'Windows'"}
4242
pyarrow = ">=13.0.0"
43-
requests = ">=2.25.1"
43+
requests = ">=2.27.0"
4444
zstandard = ">=0.21.0"
4545

4646
[tool.poetry.group.dev.dependencies]

tests/test_historical_batch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def test_batch_list_jobs_sends_expected_request(
125125
assert call["headers"]["accept"] == "application/json"
126126
assert all(v in call["headers"]["user-agent"] for v in ("Databento/", "Python/"))
127127
assert call["params"] == [
128-
("states", "received,queued,processing,done"),
128+
("states", "queued,processing,done"),
129129
("since", "2022-01-01"),
130130
]
131131
assert call["timeout"] == (100, 100)

0 commit comments

Comments
 (0)