Skip to content

Commit 472d128

Browse files
authored
VER: Release 0.15.1
See release notes.
2 parents 444d68a + b2abb91 commit 472d128

37 files changed

+941
-663
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
echo "RELEASE_NAME=$(poetry version)" >> $GITHUB_ENV
2828
echo "TAG_NAME=v$(poetry version -s)" >> $GITHUB_ENV
2929
echo "## Release notes" > NOTES.md
30-
sed -n '4,/^$/p' CHANGELOG.md >> NOTES.md
30+
sed -n '/^## /{n; :a; /^## /q; p; n; ba}' CHANGELOG.md >> NOTES.md
3131
3232
- name: Release
3333
uses: softprops/action-gh-release@v1

CHANGELOG.md

Lines changed: 100 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,67 @@
11
# Changelog
22

3+
## 0.15.1 - 2023-07-05
4+
5+
#### Bug Fixes
6+
- Fixed an `ImportError` observed in Python 3.8
7+
8+
## 0.15.0 - 2023-07-03
9+
10+
#### Enhancements
11+
- Added `symbology_map` property to `Live` client
12+
- Added `optional_symbols_list_to_list` parsing function
13+
- Changed `Live.add_callback` and `Live.add_stream` to accept an exception callback
14+
- Changed `Live.__iter__()` and `Live.__aiter__()` to send the session start message if the session is connected but not started
15+
- Upgraded `databento-dbn` to 0.7.1
16+
- Removed exception chaining from exceptions emitted by the library
17+
18+
#### Bug fixes
19+
- Fixed issue where a large unreadable symbol subscription message could be sent
20+
21+
#### Breaking changes
22+
- Removed `Encoding`, `Compression`, `Schema`, and `SType` enums as they are now exposed by `databento-dbn`
23+
- Renamed `func` parameter to `record_callback` for `Live.add_callback` and `Live.add_stream`
24+
- Removed `optional_symbols_list_to_string` parsing function
25+
326
## 0.14.1 - 2023-06-16
27+
428
- Fixed issue where `DBNStore.to_df()` would raise an exception if no records were present
529
- Fixed exception message when creating a DBNStore from an empty data source
630

731
## 0.14.0 - 2023-06-14
8-
- Added support for reusing a `Live` client to reconnect
9-
- Added `metadata` property to `Live`
32+
33+
#### Enhancements
1034
- Added `DatatbentoLiveProtocol` class
35+
- Added `metadata` property to `Live`
36+
- Added support for reusing a `Live` client to reconnect
1137
- Added support for emitting warnings in API response headers
38+
- Relaxed 10 minute minimum request time range restriction
39+
- Upgraded `aiohttp` to 3.8.3
40+
- Upgraded `numpy` to 1.23.5
41+
- Upgraded `pandas` to 1.5.3
42+
- Upgraded `requests` to 2.28.1
43+
- Upgraded `zstandard` to 0.21.0
44+
45+
#### Breaking changes
46+
- Removed support for Python 3.7
47+
- Renamed `symbol` to `raw_symbol` in definition schema when converting to a DataFrame
1248
- Changed iteration of `Live` to no longer yield DBN metadata
1349
- Changed `Live` callbacks to no longer yield DBN metadata
50+
51+
#### Bug fixes
1452
- Fixed issue where `Historical.timeseries.get_range` would write empty files on error
1553
- Fixed issue with `numpy` types not being handled in symbols field
16-
- Upgraded `aiohttp` to 3.8.3
17-
- Upgraded `numpy` to to 1.23.5
18-
- Upgraded `pandas` to to 1.5.3
19-
- Upgraded `requests` to to 2.28.1
20-
- Upgraded `zstandard` to to 0.21.0
21-
- Removed 10 minute minimum request time range restriction
22-
- Removed support for Python 3.7
54+
- Fixed optional `end` parameter for `batch.submit_job(...)`
2355

2456
## 0.13.0 - 2023-06-02
57+
58+
#### Enhancements
2559
- Added support for `statistics` schema
2660
- Added batch download support data files (`condition.json` and `symbology.json`)
27-
- Upgraded `databento-dbn` to 0.6.1
2861
- Renamed `booklevel` MBP field to `levels` for brevity and consistent naming
62+
- Upgraded `databento-dbn` to 0.6.1
63+
64+
#### Breaking changes
2965
- Changed `flags` field to an unsigned int
3066
- Changed default of `ts_out` to `False` for `Live` client
3167
- Changed `instrument_class` DataFrame representation to be consistent with other `char` types
@@ -34,85 +70,118 @@
3470
- Removed support for legacy stypes
3571

3672
## 0.12.0 - 2023-05-01
73+
74+
#### Enhancements
3775
- Added `Live` client for connecting to Databento's live service
76+
- Added `degraded`, `pending` and `missing` condition variants for `batch.get_dataset_condition`
77+
- Added `last_modified_date` field to `batch.get_dataset_condition` response
3878
- Upgraded `databento-dbn` to 0.5.0
3979
- Upgraded `DBNStore` to support mixed schema types to support live data
80+
81+
#### Breaking changes
4082
- Changed iteration `DBNStore` to return record types from `databento-dbn` instead of numpy arrays
41-
- Removed `dtype` property from `DBNStore`
42-
- Removed `record_size` property from `DBNStore`
4383
- Renamed the `cost` field to `cost_usd` for `batch.submit_job` and `batch.list_jobs` (value now expressed as US dollars)
44-
- Removed `bad` condition variant from `batch.get_dataset_condition`
45-
- Added `degraded`, `pending` and `missing` condition variants for `batch.get_dataset_condition`
46-
- Added `last_modified_date` field to `batch.get_dataset_condition` response
4784
- Renamed `product_id` field to `instrument_id`
4885
- Renamed `symbol` field in definitions to `raw_symbol`
49-
- Deprecated `SType.PRODUCT_ID` to `SType.INSTRUMENT_ID`
50-
- Deprecated `SType.NATIVE` to `SType.RAW_SYMBOL`
51-
- Deprecated `SType.SMART` to `SType.PARENT` and `SType.CONTINUOUS`
86+
- Removed `dtype` property from `DBNStore`
87+
- Removed `record_size` property from `DBNStore`
88+
- Removed `bad` condition variant from `batch.get_dataset_condition`
5289
- Removed unused `LiveGateway` enum
5390
- Removed `STATSTICS` from `Schema` enum
5491
- Removed `STATUS` from `Schema` enum
5592
- Removed `GATEWAY_ERROR` from `Schema` enum
5693
- Removed `SYMBOL_MAPPING` from `Schema` enum
5794

95+
#### Deprecations
96+
- Deprecated `SType.PRODUCT_ID` to `SType.INSTRUMENT_ID`
97+
- Deprecated `SType.NATIVE` to `SType.RAW_SYMBOL`
98+
- Deprecated `SType.SMART` to `SType.PARENT` and `SType.CONTINUOUS`
99+
58100
## 0.11.0 - 2023-04-13
101+
59102
- Changed `end` and `end_date` to optional to support new forward-fill behaviour
60103
- Upgraded `zstandard` to 0.20.0
61104

62105
## 0.10.0 - 2023-04-07
106+
107+
#### Enhancements
108+
- Added support for `imbalance` schema
109+
- Added `instrument_class`, `strike_price`, and `strike_price_currency` to definition
110+
schema
111+
- Changed parsing of `end` and `end_date` params throughout the API
112+
- Improved exception messages for server and client timeouts
63113
- Upgraded `databento-dbn` to 0.4.3
114+
115+
#### Breaking changes
64116
- Renamed `Bento` class to `DBNStore`
65117
- Removed `metadata.list_compressions` (redundant with docs)
66118
- Removed `metadata.list_encodings` (redundant with docs)
67119
- Removed optional `start` and `end` params from `metadata.list_schemas` (redundant)
68120
- Removed `related` and `related_security_id` from definition schema
69-
- Added `instrument_class`, `strike_price`, and `strike_price_currency` to definition
70-
schema
71-
- Added support for `imbalance` schema
72-
- Improved exception messages for server and client timeouts
73121

74122
## 0.9.0 - 2023-03-10
75-
- Removed `record_count` property from Bento class
76-
- Fixed bug in `Bento` where invalid metadata would prevent iteration
123+
124+
#### Enhancements
77125
- Improved use of the logging module
126+
127+
#### Breaking changes
128+
- Removed `record_count` property from Bento class
78129
- Changed `metadata.get_dataset_condition` response to a list of condition per date
79130

131+
#### Bug fixes
132+
- Fixed bug in `Bento` where invalid metadata would prevent iteration
133+
80134
## 0.8.1 - 2023-03-05
81-
- Fixed bug in `Bento` iteration where multiple readers were created
135+
136+
#### Enhancements
82137
- Added `from_dbn` convenience alias for loading DBN files
83138

139+
#### Bug fixes
140+
- Fixed bug in `Bento` iteration where multiple readers were created
141+
84142
## 0.8.0 - 2023-03-03
85-
- Integrated DBN encoding 0.3.2
86-
- Renamed `timeseries.stream` to `timeseries.get_range`
87-
- Renamed `timeseries.stream_async` to `timeseries.get_range_async`
88-
- Deprecated `timeseries.stream(...)` method
89-
- Deprecated `timeseries.stream_async(...)` method
143+
144+
#### Enhancements
90145
- Added `batch.list_files(...)` method
91146
- Added `batch.download(...)` method
92147
- Added `batch.download_async(...)` method
148+
- Integrated DBN encoding 0.3.2
149+
150+
#### Breaking changes
151+
- Dropped support for DBZ encoding
152+
- Renamed `timeseries.stream` to `timeseries.get_range`
153+
- Renamed `timeseries.stream_async` to `timeseries.get_range_async`
93154
- Changed `.to_df(...)` `pretty_ts` default argument to `True`
94155
- Changed `.to_df(...)` `pretty_px` default argument to `True`
95156
- Changed `.to_df(...)` `map_symbols` default argument to `True`
96-
- Drop support for DBZ encoding
157+
158+
#### Deprecations
159+
- Deprecated `timeseries.stream(...)` method
160+
- Deprecated `timeseries.stream_async(...)` method
97161

98162
## 0.7.0 - 2023-01-10
163+
99164
- Added support for `definition` schema
100165
- Updated `Flags` enum
101166
- Upgraded `dbz-python` to 0.2.1
102167
- Upgraded `zstandard` to 0.19.0
103168

104169
## 0.6.0 - 2022-12-02
170+
105171
- Added `metadata.get_dataset_condition` method to `Historical` client
106172
- Upgraded `dbz-python` to 0.2.0
107173

108174
## 0.5.0 - 2022-11-07
175+
109176
- Fixed dataframe columns for derived data schemas (dropped `channel_id`)
110177
- Fixed `batch.submit_job` requests for `dbz` encoding
111178
- Updated `quickstart.ipynb` jupyter notebook
112179

113180
## 0.4.0 - 2022-09-14
181+
114182
- Upgraded `dbz-python` to 0.1.5
115183
- Added `map_symbols` option for `.to_df()` (experimental)
116184

117185
## 0.3.0 - 2022-08-30
186+
118187
- Initial release

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ The library is fully compatible with the latest distribution of Anaconda 3.8 and
3232
The minimum dependencies as found in the `pyproject.toml` are also listed below:
3333
- python = "^3.8"
3434
- aiohttp = "^3.8.3"
35-
- databento-dbn = "0.6.1"
35+
- databento-dbn = "0.7.1"
3636
- numpy= ">=1.23.5"
3737
- pandas = ">=1.5.3"
38-
- requests = ">=2.28.1"
38+
- requests = ">=2.24.0"
3939
- zstandard = ">=0.21.0"
4040

4141
## Installation

databento/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import logging
22
import warnings
33

4+
from databento_dbn import Compression
5+
from databento_dbn import Encoding
46
from databento_dbn import ErrorMsg
57
from databento_dbn import ImbalanceMsg
68
from databento_dbn import InstrumentDefMsg
@@ -9,25 +11,23 @@
911
from databento_dbn import MBP10Msg
1012
from databento_dbn import Metadata
1113
from databento_dbn import OHLCVMsg
14+
from databento_dbn import Schema
1215
from databento_dbn import StatMsg
16+
from databento_dbn import SType
1317
from databento_dbn import SymbolMappingMsg
1418
from databento_dbn import SystemMsg
1519
from databento_dbn import TradeMsg
1620

1721
from databento.common import bentologging
1822
from databento.common.dbnstore import DBNStore
19-
from databento.common.enums import Compression
2023
from databento.common.enums import Dataset
2124
from databento.common.enums import Delivery
22-
from databento.common.enums import Encoding
2325
from databento.common.enums import FeedMode
2426
from databento.common.enums import HistoricalGateway
2527
from databento.common.enums import Packaging
2628
from databento.common.enums import RecordFlags
2729
from databento.common.enums import RollRule
28-
from databento.common.enums import Schema
2930
from databento.common.enums import SplitDuration
30-
from databento.common.enums import SType
3131
from databento.common.enums import SymbologyResolution
3232
from databento.common.error import BentoClientError
3333
from databento.common.error import BentoError

databento/common/data.py

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,33 @@
11
from __future__ import annotations
22

33
import numpy as np
4-
5-
from databento.common.enums import Schema
6-
4+
from databento_dbn import ImbalanceMsg
5+
from databento_dbn import InstrumentDefMsg
6+
from databento_dbn import MBOMsg
7+
from databento_dbn import MBP1Msg
8+
from databento_dbn import MBP10Msg
9+
from databento_dbn import OHLCVMsg
10+
from databento_dbn import Schema
11+
from databento_dbn import StatMsg
12+
from databento_dbn import TradeMsg
13+
14+
from databento.live import DBNRecord
15+
16+
17+
SCHEMA_STRUCT_MAP: dict[Schema, type[DBNRecord]] = {
18+
Schema.DEFINITION: InstrumentDefMsg,
19+
Schema.IMBALANCE: ImbalanceMsg,
20+
Schema.MBO: MBOMsg,
21+
Schema.MBP_1: MBP1Msg,
22+
Schema.MBP_10: MBP10Msg,
23+
Schema.OHLCV_1S: OHLCVMsg,
24+
Schema.OHLCV_1M: OHLCVMsg,
25+
Schema.OHLCV_1H: OHLCVMsg,
26+
Schema.OHLCV_1D: OHLCVMsg,
27+
Schema.STATISTICS: StatMsg,
28+
Schema.TBBO: MBP1Msg,
29+
Schema.TRADES: TradeMsg,
30+
}
731

832
################################################################################
933
# DBN struct schema
@@ -284,9 +308,10 @@ def get_deriv_ba_fields(level: int) -> list[str]:
284308
DEFINITION_DROP_COLUMNS = [
285309
"length",
286310
"rtype",
287-
"reserved1",
288-
"reserved2",
289-
"reserved3",
311+
"_reserved1",
312+
"_reserved2",
313+
"_reserved3",
314+
"_reserved4",
290315
"dummy",
291316
]
292317

databento/common/dbnstore.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@
1919
import numpy as np
2020
import pandas as pd
2121
import zstandard
22+
from databento_dbn import Compression
2223
from databento_dbn import DBNDecoder
2324
from databento_dbn import ErrorMsg
2425
from databento_dbn import Metadata
26+
from databento_dbn import Schema
27+
from databento_dbn import SType
2528
from databento_dbn import SymbolMappingMsg
2629
from databento_dbn import SystemMsg
2730

@@ -30,10 +33,8 @@
3033
from databento.common.data import DEFINITION_PRICE_COLUMNS
3134
from databento.common.data import DEFINITION_TYPE_MAX_MAP
3235
from databento.common.data import DERIV_SCHEMAS
36+
from databento.common.data import SCHEMA_STRUCT_MAP
3337
from databento.common.data import STRUCT_MAP
34-
from databento.common.enums import Compression
35-
from databento.common.enums import Schema
36-
from databento.common.enums import SType
3738
from databento.common.error import BentoError
3839
from databento.common.symbology import InstrumentIdMappingInterval
3940
from databento.common.validation import validate_maybe_enum
@@ -788,10 +789,9 @@ def replay(self, callback: Callable[[Any], None]) -> None:
788789
for record in self:
789790
try:
790791
callback(record)
791-
except Exception as exc:
792+
except Exception:
792793
logger.exception(
793794
"exception while replaying to user callback",
794-
exc_info=exc,
795795
)
796796
raise
797797

@@ -1059,7 +1059,7 @@ def to_ndarray(
10591059
schema = self.schema
10601060

10611061
schema_records = filter(
1062-
lambda r: isinstance(r, schema.get_record_type()), # type: ignore
1062+
lambda r: isinstance(r, SCHEMA_STRUCT_MAP[schema]), # type: ignore
10631063
self,
10641064
)
10651065

0 commit comments

Comments
 (0)