File tree Expand file tree Collapse file tree 4 files changed +36
-4
lines changed
Expand file tree Collapse file tree 4 files changed +36
-4
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 1- __version__ = "0.8.0 "
1+ __version__ = "0.8.1 "
Original file line number Diff line number Diff line change 1- mypy>=0.991
1+ mypy>=1.0.1
22pytest>=7.2.0
33pytest-mock>=3.10.0
44types-requests
Original file line number Diff line number Diff line change 1+ import collections
12import datetime as dt
23import sys
34from pathlib import Path
45from typing import List , Tuple , Union
56
7+ import databento
68import numpy as np
79import pandas as pd
810import 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+
187201def 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(
372386def 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+
383411def 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 )
You can’t perform that action at this time.
0 commit comments