From ea8f6eb710396bd68a9dd7292099be2100f5c607 Mon Sep 17 00:00:00 2001 From: Nick Macholl Date: Tue, 17 Dec 2024 12:31:59 -0800 Subject: [PATCH] MOD: Upgrade databento-dbn to the latest --- CHANGELOG.md | 8 ++++++++ README.md | 2 +- databento/__init__.py | 23 +++++++++++++++-------- databento/common/dbnstore.py | 2 +- databento/live/protocol.py | 2 +- pyproject.toml | 2 +- 6 files changed, 27 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bcb570..7597f33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.47.0 - TBD + +#### Enhancements +- Upgraded `databento-dbn` to 0.25.0 + - Added type aliases for `TBBOMsg`, `BBO1SMsg`, `BBO1MMsg`, `TCBBOMsg`, `CBBO1SMsg`, + `CBBO1MMsg` in Python +- Removed exports for `CBBOMsg` and `BBOMsg` in the root `databento` package in favor of aliased versions from `databento-dbn` + ## 0.46.0 - 2024-12-10 #### Enhancements diff --git a/README.md b/README.md index 61ad7f8..692f66d 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ The library is fully compatible with the latest distribution of Anaconda 3.9 and The minimum dependencies as found in the `pyproject.toml` are also listed below: - python = "^3.9" - aiohttp = "^3.8.3" -- databento-dbn = "0.24.0" +- databento-dbn = "0.25.0" - numpy= ">=1.23.5" - pandas = ">=1.5.3" - pip-system-certs = ">=4.0" (Windows only) diff --git a/databento/__init__.py b/databento/__init__.py index 8e68bb2..c06e4ab 100644 --- a/databento/__init__.py +++ b/databento/__init__.py @@ -1,8 +1,7 @@ import logging import warnings -from databento_dbn import BBOMsg -from databento_dbn import CBBOMsg +from databento_dbn import CMBP1Msg from databento_dbn import Compression from databento_dbn import Encoding from databento_dbn import ErrorMsg @@ -21,6 +20,12 @@ from databento_dbn import SymbolMappingMsg from databento_dbn import SystemMsg from databento_dbn import TradeMsg +from databento_dbn.v2 import BBO1MMsg +from databento_dbn.v2 import BBO1SMsg +from databento_dbn.v2 import CBBO1MMsg +from databento_dbn.v2 import CBBO1SMsg +from databento_dbn.v2 import TBBOMsg +from databento_dbn.v2 import TCBBOMsg from databento.common import API_VERSION from databento.common import bentologging @@ -50,18 +55,17 @@ from databento.version import __version__ # noqa -# Alias for convenience -TBBOMsg = MBP1Msg - - __all__ = [ "API_VERSION", - "BBOMsg", + "BBO1MMsg", + "BBO1SMsg", "BentoClientError", "BentoError", "BentoHttpError", "BentoServerError", - "CBBOMsg", + "CBBO1MMsg", + "CBBO1SMsg", + "CMBP1Msg", "Compression", "DBNRecord", "DBNStore", @@ -96,6 +100,9 @@ "SymbolMappingMsg", "SymbologyResolution", "SystemMsg", + "TBBOMsg", + "TBBOMsg", + "TCBBOMsg", "TradeMsg", "Venue", ] diff --git a/databento/common/dbnstore.py b/databento/common/dbnstore.py index ec3839e..cc18833 100644 --- a/databento/common/dbnstore.py +++ b/databento/common/dbnstore.py @@ -380,7 +380,7 @@ def __init__(self, data_source: DataSource) -> None: def __iter__(self) -> Generator[DBNRecord, None, None]: reader = self.reader decoder = DBNDecoder( - upgrade_policy=VersionUpgradePolicy.UPGRADE, + upgrade_policy=VersionUpgradePolicy.UPGRADE_TO_V2, ) while True: raw = reader.read(DBNStore.DBN_READ_SIZE) diff --git a/databento/live/protocol.py b/databento/live/protocol.py index 9ee3897..d7d18a1 100644 --- a/databento/live/protocol.py +++ b/databento/live/protocol.py @@ -82,7 +82,7 @@ def __init__( self._heartbeat_interval_s = heartbeat_interval_s self._dbn_decoder = databento_dbn.DBNDecoder( - upgrade_policy=VersionUpgradePolicy.UPGRADE, + upgrade_policy=VersionUpgradePolicy.UPGRADE_TO_V2, ) self._gateway_decoder = GatewayDecoder() diff --git a/pyproject.toml b/pyproject.toml index fe3a276..4a25c21 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ aiohttp = [ {version = "^3.8.3", python = "<3.12"}, {version = "^3.9.0", python = "^3.12"} ] -databento-dbn = "0.24.0" +databento-dbn = "0.25.0" numpy = [ {version = ">=1.23.5", python = "<3.12"}, {version = ">=1.26.0", python = "^3.12"}