Skip to content

Commit

Permalink
MOD: Upgrade to databento_dbn to 0.17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nmacholl committed Apr 3, 2024
1 parent df58449 commit 8b4e384
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog

## 0.31.2 - TBD
## 0.32.0 - TBD

#### Enhancements
- Upgraded `databento-dbn` to 0.17.0

#### Bug fixes
- Removed live session ID parsing to `int`, that could cause a session to fail when
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The library is fully compatible with the latest distribution of Anaconda 3.8 and
The minimum dependencies as found in the `pyproject.toml` are also listed below:
- python = "^3.8"
- aiohttp = "^3.8.3"
- databento-dbn = "0.16.0"
- databento-dbn = "0.17.0"
- numpy= ">=1.23.5"
- pandas = ">=1.5.3"
- pyarrow = ">=13.0.0"
Expand Down
8 changes: 8 additions & 0 deletions databento/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Final

import numpy as np
from databento_dbn import CbboMsg
from databento_dbn import ImbalanceMsg
from databento_dbn import InstrumentDefMsg
from databento_dbn import InstrumentDefMsgV1
Expand Down Expand Up @@ -36,9 +37,16 @@
Schema.OHLCV_1M: OHLCVMsg,
Schema.OHLCV_1H: OHLCVMsg,
Schema.OHLCV_1D: OHLCVMsg,
Schema.OHLCV_EOD: OHLCVMsg,
Schema.STATISTICS: StatMsg,
Schema.TBBO: MBP1Msg,
Schema.TRADES: TradeMsg,
Schema.CBBO: CbboMsg,
Schema.CBBO_1S: CbboMsg,
Schema.CBBO_1M: CbboMsg,
Schema.TCBBO: CbboMsg,
Schema.BBO_1S: MBP1Msg,
Schema.BBO_1M: MBP1Msg,
}

SCHEMA_STRUCT_MAP_V1: Final[dict[Schema, type[DBNRecord]]] = {
Expand Down
2 changes: 2 additions & 0 deletions databento/common/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@


DBNRecord = Union[
databento_dbn.CbboMsg,
databento_dbn.MBOMsg,
databento_dbn.MBP1Msg,
databento_dbn.MBP10Msg,
Expand All @@ -18,6 +19,7 @@
databento_dbn.InstrumentDefMsg,
databento_dbn.InstrumentDefMsgV1,
databento_dbn.StatMsg,
databento_dbn.StatusMsg, # type: ignore [name-defined]
databento_dbn.SymbolMappingMsg,
databento_dbn.SymbolMappingMsgV1,
databento_dbn.SystemMsg,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ aiohttp = [
{version = "^3.8.3", python = "<3.12"},
{version = "^3.9.0", python = "^3.12"}
]
databento-dbn = "0.16.0"
databento-dbn = "0.17.0"
numpy = [
{version = ">=1.23.5", python = "<3.12"},
{version = "^1.26.0", python = "^3.12"}
Expand Down
12 changes: 12 additions & 0 deletions tests/test_live_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,18 @@ async def test_live_stream_with_reconnect(
pytest.skip("no stub data for ohlcv-eod schema")
if schema == "imbalance":
pytest.skip("imbalance is not supported for GLBX.MDP3")
if schema == "cbbo":
pytest.skip("no stub data for cbbo schema")
if schema == "cbbo-1s":
pytest.skip("no stub data for cbbo-1s schema")
if schema == "cbbo-1m":
pytest.skip("no stub data for cbbo-1m schema")
if schema == "bbo-1s":
pytest.skip("no stub data for bbo-1s schema")
if schema == "bbo-1m":
pytest.skip("no stub data for bbo-1m schema")
if schema == "tcbbo":
pytest.skip("no stub data for tcbbo schema")

output = tmp_path / "output.dbn"
live_client.add_stream(output.open("wb", buffering=0))
Expand Down

0 comments on commit 8b4e384

Please sign in to comment.