Skip to content

Commit d93c7de

Browse files
committed
VER: Release databento-python 0.8.1
1 parent 7b359b6 commit d93c7de

File tree

4 files changed

+36
-4
lines changed

4 files changed

+36
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# Changelog
22

3+
## 0.8.1 - 2023-03-05
4+
- Fixed bug in `Bento` iteration where multiple readers were created
5+
- Added `from_dbn` convenience alias for loading DBN files
6+
37
## 0.8.0 - 2023-03-03
4-
- Integrate DBN encoding `0.3.2`
8+
- Integrated DBN encoding `0.3.2`
59
- Renamed `timeseries.stream` to `timeseries.get_range`
610
- Renamed `timeseries.stream_async` to `timeseries.get_range_async`
711
- Deprecated `timeseries.stream(...)` method

databento/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.8.0"
1+
__version__ = "0.8.1"

requirements_dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
mypy>=0.991
1+
mypy>=1.0.1
22
pytest>=7.2.0
33
pytest-mock>=3.10.0
44
types-requests

tests/test_historical_bento.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import collections
12
import datetime as dt
23
import sys
34
from pathlib import Path
45
from typing import List, Tuple, Union
56

7+
import databento
68
import numpy as np
79
import pandas as pd
810
import pytest
@@ -184,6 +186,18 @@ def test_to_ndarray_with_stub_data_returns_expected_array() -> None:
184186
)
185187

186188

189+
def test_iterator_produces_expected_data() -> None:
190+
# Arrange
191+
stub_data = get_test_data(schema=Schema.MBO)
192+
data = Bento.from_bytes(data=stub_data)
193+
194+
# Act (consume iterator)
195+
handler = collections.deque(data)
196+
197+
# Assert
198+
assert len(handler) == 2
199+
200+
187201
def test_replay_with_stub_data_record_passes_to_callback() -> None:
188202
# Arrange
189203
stub_data = get_test_data(schema=Schema.MBO)
@@ -372,14 +386,28 @@ def test_to_df_with_pretty_px_with_various_schemas_converts_prices_as_expected(
372386
def test_from_file_given_various_paths_returns_expected_metadata(
373387
expected_schema: Schema,
374388
) -> None:
375-
# Arrange, Act
389+
# Arrange
376390
path = get_test_data_path(schema=expected_schema)
391+
392+
# Act
377393
data = Bento.from_file(path=path)
378394

379395
# Assert
380396
assert data.schema == expected_schema
381397

382398

399+
def test_from_dbn_alias() -> None:
400+
# Arrange
401+
path = get_test_data_path(schema=Schema.MBO)
402+
403+
# Act
404+
data = databento.from_dbn(path=path)
405+
406+
# Assert
407+
assert data.schema == Schema.MBO
408+
assert data.record_count == 2
409+
410+
383411
def test_mbo_to_csv_writes_expected_file_to_disk(tmp_path: Path) -> None:
384412
# Arrange
385413
test_data_path = get_test_data_path(schema=Schema.MBO)

0 commit comments

Comments
 (0)