diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e140b4..f9039d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 0.69.0 - 2026-01-13 + +#### Enhancements +- Upgraded `databento-dbn` to 0.46.0 + - Added `DBNRecord` union type to Python which includes all record types + - Removed `Record` class from Python type stubs to match code: the record classes don't + share a base class. Use `DBNRecord` instead. + +#### Breaking changes +- Removed `DBNRecord` union type from `databento.common.types`, use `databento_dbn.DBNRecord` instead + ## 0.68.2 - 2026-01-06 #### Bug fixes diff --git a/README.md b/README.md index 2cee56a..a53d7bf 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ The library is fully compatible with distributions of Anaconda 2023.x and above. The minimum dependencies as found in the `pyproject.toml` are also listed below: - python = "^3.10" - aiohttp = "^3.8.3" -- databento-dbn = "~0.45.0" +- databento-dbn = "~0.46.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 4d61a50..df2c5c1 100644 --- a/databento/__init__.py +++ b/databento/__init__.py @@ -14,6 +14,7 @@ from databento_dbn import CMBP1Msg from databento_dbn import Compression from databento_dbn import ConsolidatedBidAskPair +from databento_dbn import DBNRecord from databento_dbn import Encoding from databento_dbn import ErrorCode from databento_dbn import ErrorMsg @@ -74,7 +75,6 @@ from databento.common.publishers import Publisher from databento.common.publishers import Venue from databento.common.symbology import InstrumentMap -from databento.common.types import DBNRecord from databento.historical.client import Historical from databento.live.client import Live from databento.reference.client import Reference diff --git a/databento/common/constants.py b/databento/common/constants.py index 6f1dc13..0384460 100644 --- a/databento/common/constants.py +++ b/databento/common/constants.py @@ -4,6 +4,7 @@ from databento_dbn import BBOMsg from databento_dbn import CBBOMsg from databento_dbn import CMBP1Msg +from databento_dbn import DBNRecord from databento_dbn import ImbalanceMsg from databento_dbn import InstrumentDefMsg from databento_dbn import MBOMsg @@ -17,8 +18,6 @@ from databento_dbn import v1 from databento_dbn import v2 -from databento.common.types import DBNRecord - ALL_SYMBOLS: Final = "ALL_SYMBOLS" diff --git a/databento/common/dbnstore.py b/databento/common/dbnstore.py index dc1a09f..f194c71 100644 --- a/databento/common/dbnstore.py +++ b/databento/common/dbnstore.py @@ -35,6 +35,7 @@ from databento_dbn import UNDEF_PRICE from databento_dbn import Compression from databento_dbn import DBNDecoder +from databento_dbn import DBNRecord from databento_dbn import Encoding from databento_dbn import InstrumentDefMsg from databento_dbn import InstrumentDefMsgV1 @@ -54,7 +55,6 @@ from databento.common.error import BentoError from databento.common.error import BentoWarning from databento.common.symbology import InstrumentMap -from databento.common.types import DBNRecord from databento.common.types import Default from databento.common.types import MappingIntervalDict from databento.common.validation import validate_enum diff --git a/databento/common/types.py b/databento/common/types.py index f8bc032..39c55c2 100644 --- a/databento/common/types.py +++ b/databento/common/types.py @@ -17,30 +17,6 @@ logger = logging.getLogger(__name__) -DBNRecord = ( - databento_dbn.BBOMsg - | databento_dbn.CBBOMsg - | databento_dbn.CMBP1Msg - | databento_dbn.MBOMsg - | databento_dbn.MBP1Msg - | databento_dbn.MBP10Msg - | databento_dbn.TradeMsg - | databento_dbn.OHLCVMsg - | databento_dbn.ImbalanceMsg - | databento_dbn.InstrumentDefMsg - | databento_dbn.InstrumentDefMsgV1 - | databento_dbn.InstrumentDefMsgV2 - | databento_dbn.StatMsg - | databento_dbn.StatMsgV1 - | databento_dbn.StatusMsg - | databento_dbn.SymbolMappingMsg - | databento_dbn.SymbolMappingMsgV1 - | databento_dbn.SystemMsg - | databento_dbn.SystemMsgV1 - | databento_dbn.ErrorMsg - | databento_dbn.ErrorMsgV1 -) - _T = TypeVar("_T") @@ -95,7 +71,7 @@ class MappingIntervalDict(TypedDict): symbol: str -RecordCallback = Callable[[DBNRecord], None] +RecordCallback = Callable[[databento_dbn.DBNRecord], None] ExceptionCallback = Callable[[Exception], None] ReconnectCallback = Callable[[pd.Timestamp, pd.Timestamp], None] @@ -243,7 +219,7 @@ def callback_name(self) -> str: def exc_callback_name(self) -> str: return getattr(self._exc_fn, "__name__", str(self._exc_fn)) - def call(self, record: DBNRecord) -> None: + def call(self, record: databento_dbn.DBNRecord) -> None: """ Execute the callback function, passing `record` in as the first argument. Any exceptions encountered will be dispatched to the diff --git a/databento/live/client.py b/databento/live/client.py index 0ea5244..8fc1078 100644 --- a/databento/live/client.py +++ b/databento/live/client.py @@ -14,6 +14,7 @@ import databento_dbn import pandas as pd +from databento_dbn import DBNRecord from databento_dbn import Schema from databento_dbn import SType @@ -25,7 +26,6 @@ from databento.common.publishers import Dataset from databento.common.types import ClientRecordCallback from databento.common.types import ClientStream -from databento.common.types import DBNRecord from databento.common.types import ExceptionCallback from databento.common.types import ReconnectCallback from databento.common.types import RecordCallback @@ -57,7 +57,8 @@ class Live: gateway. heartbeat_interval_s: int, optional The interval in seconds at which the gateway will send heartbeat records if no - other data records are sent. + other data records are sent. By default heartbeats will be sent at the gateway's + default interval. Minimum interval is 5 seconds. reconnect_policy: ReconnectPolicy | str, optional The reconnect policy for the live session. - "none": the client will not reconnect (default) diff --git a/databento/live/protocol.py b/databento/live/protocol.py index 4c33deb..30fec68 100644 --- a/databento/live/protocol.py +++ b/databento/live/protocol.py @@ -7,6 +7,7 @@ from typing import Final import databento_dbn +from databento_dbn import DBNRecord from databento_dbn import Metadata from databento_dbn import Schema from databento_dbn import SType @@ -19,7 +20,6 @@ from databento.common.parsing import optional_datetime_to_unix_nanoseconds from databento.common.parsing import symbols_list_to_list from databento.common.publishers import Dataset -from databento.common.types import DBNRecord from databento.common.validation import validate_enum from databento.common.validation import validate_semantic_string from databento.live.gateway import AuthenticationRequest diff --git a/databento/live/session.py b/databento/live/session.py index c56848c..a1563a0 100644 --- a/databento/live/session.py +++ b/databento/live/session.py @@ -14,6 +14,7 @@ import databento_dbn import pandas as pd +from databento_dbn import DBNRecord from databento_dbn import Schema from databento_dbn import SType @@ -23,7 +24,6 @@ from databento.common.publishers import Dataset from databento.common.types import ClientRecordCallback from databento.common.types import ClientStream -from databento.common.types import DBNRecord from databento.common.types import ExceptionCallback from databento.common.types import ReconnectCallback from databento.live.gateway import SubscriptionRequest diff --git a/databento/version.py b/databento/version.py index 8266363..786600a 100644 --- a/databento/version.py +++ b/databento/version.py @@ -1 +1 @@ -__version__ = "0.68.2" +__version__ = "0.69.0" diff --git a/pyproject.toml b/pyproject.toml index 7689fd6..d875ba5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "databento" -version = "0.68.2" +version = "0.69.0" description = "Official Python client library for Databento" readme = "README.md" requires-python = ">=3.10" @@ -10,7 +10,7 @@ dynamic = [ "classifiers" ] dependencies = [ "aiohttp>=3.8.3,<4.0.0; python_version < '3.12'", "aiohttp>=3.9.0,<4.0.0; python_version >= '3.12'", - "databento-dbn~=0.45.0", + "databento-dbn~=0.46.0", "numpy>=1.23.5; python_version < '3.12'", "numpy>=1.26.0; python_version >= '3.12'", "pandas>=1.5.3", diff --git a/tests/test_historical_bento.py b/tests/test_historical_bento.py index 6620d18..50f67a3 100644 --- a/tests/test_historical_bento.py +++ b/tests/test_historical_bento.py @@ -15,6 +15,7 @@ import pytz import zstandard from databento_dbn import Compression +from databento_dbn import DBNRecord from databento_dbn import MBOMsg from databento_dbn import Schema from databento_dbn import SType @@ -26,7 +27,6 @@ from databento.common.error import BentoError from databento.common.error import BentoWarning from databento.common.publishers import Dataset -from databento.common.types import DBNRecord def test_from_file_when_not_exists_raises_expected_exception() -> None: diff --git a/tests/test_live_client.py b/tests/test_live_client.py index 492bac6..829e73d 100644 --- a/tests/test_live_client.py +++ b/tests/test_live_client.py @@ -15,6 +15,7 @@ import databento_dbn import pytest import zstandard +from databento_dbn import DBNRecord from databento_dbn import Encoding from databento_dbn import Schema from databento_dbn import SType @@ -25,7 +26,6 @@ from databento.common.dbnstore import DBNStore from databento.common.error import BentoError from databento.common.publishers import Dataset -from databento.common.types import DBNRecord from databento.live import client from databento.live import gateway from databento.live import protocol diff --git a/tests/test_live_client_reconnect.py b/tests/test_live_client_reconnect.py index 99e9286..cd6b630 100644 --- a/tests/test_live_client_reconnect.py +++ b/tests/test_live_client_reconnect.py @@ -6,12 +6,12 @@ import pandas as pd import pytest +from databento_dbn import DBNRecord from databento import Dataset from databento import Schema from databento import SType from databento.common.enums import ReconnectPolicy -from databento.common.types import DBNRecord from databento.live import client from databento.live.gateway import AuthenticationRequest from databento.live.gateway import SessionStart