Skip to content

Commit 130cb8a

Browse files
committed
MOD: Upgrade python client for DBN v3
1 parent ee61862 commit 130cb8a

File tree

80 files changed

+20
-13
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+20
-13
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion

README.md

Lines changed: 1 addition & 1 deletion

databento/common/dbnstore.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ def __init__(self, data_source: DataSource) -> None:
380380
def __iter__(self) -> Generator[DBNRecord, None, None]:
381381
reader = self.reader
382382
decoder = DBNDecoder(
383-
upgrade_policy=VersionUpgradePolicy.UPGRADE_TO_V2,
383+
upgrade_policy=VersionUpgradePolicy.UPGRADE_TO_V3,
384384
)
385385
while True:
386386
raw = reader.read(DBNStore.DBN_READ_SIZE)
@@ -394,6 +394,9 @@ def __iter__(self) -> Generator[DBNRecord, None, None]:
394394
self._instrument_map.insert_symbol_mapping_msg(record)
395395
yield record
396396
else:
397+
# This call to decode is required to seek past the decoded records
398+
# This behavior will be fixed in the next version of databento_dbn
399+
_ = decoder.decode()
397400
if len(decoder.buffer()) > 0:
398401
warnings.warn(
399402
BentoWarning("DBN file is truncated or contains an incomplete record"),

databento/common/types.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
databento_dbn.ImbalanceMsg,
2222
databento_dbn.InstrumentDefMsg,
2323
databento_dbn.InstrumentDefMsgV1,
24-
databento_dbn.InstrumentDefMsgV3,
24+
databento_dbn.InstrumentDefMsgV2,
2525
databento_dbn.StatMsg,
26+
databento_dbn.StatMsgV1,
2627
databento_dbn.StatusMsg,
2728
databento_dbn.SymbolMappingMsg,
2829
databento_dbn.SymbolMappingMsgV1,

databento/live/protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def __init__(
8282
self._heartbeat_interval_s = heartbeat_interval_s
8383

8484
self._dbn_decoder = databento_dbn.DBNDecoder(
85-
upgrade_policy=VersionUpgradePolicy.UPGRADE_TO_V2,
85+
upgrade_policy=VersionUpgradePolicy.UPGRADE_TO_V3,
8686
)
8787
self._gateway_decoder = GatewayDecoder()
8888

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ aiohttp = [
3232
{version = "^3.8.3", python = "<3.12"},
3333
{version = "^3.9.0", python = "^3.12"}
3434
]
35-
databento-dbn = "0.34.0"
35+
databento-dbn = "0.35.0"
3636
numpy = [
3737
{version = ">=1.23.5", python = "<3.12"},
3838
{version = ">=1.26.0", python = "^3.12"}
1 Byte
Binary file not shown.
-1 Bytes
Binary file not shown.
7 Bytes
Binary file not shown.
3 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)