diff --git a/CHANGELOG.md b/CHANGELOG.md index d3335958..8bcb5709 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 0.46.0 - 2024-12-10 + +#### Enhancements +- Removed deprecated `packaging` parameter from `Historical.batch.submit_job`. Job files can be downloaded individually or as zip files after the job completes +- Upgraded `databento-dbn` to 0.24.0 + - Added handling for `UNDEF_TIMESTAMP` in `pretty_` timestamp getters for Python. They now return `None` in the case of `UNDEF_TIMESTAMP` + ## 0.45.0 - 2024-11-12 This release adds support for Python v3.13. diff --git a/README.md b/README.md index e99d2ac4..61ad7f86 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ The library is fully compatible with the latest distribution of Anaconda 3.9 and The minimum dependencies as found in the `pyproject.toml` are also listed below: - python = "^3.9" - aiohttp = "^3.8.3" -- databento-dbn = "0.23.1" +- databento-dbn = "0.24.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 a15195e1..8e68bb26 100644 --- a/databento/__init__.py +++ b/databento/__init__.py @@ -56,49 +56,48 @@ __all__ = [ "API_VERSION", - "DBNStore", - "DBNRecord", + "BBOMsg", "BentoClientError", "BentoError", "BentoHttpError", "BentoServerError", + "CBBOMsg", "Compression", - "Publisher", + "DBNRecord", + "DBNStore", "Dataset", - "Venue", "Delivery", "Encoding", + "ErrorMsg", "FeedMode", - "RecordFlags", "Historical", "HistoricalGateway", + "ImbalanceMsg", + "InstrumentDefMsg", "InstrumentMap", "Live", - "Reference", + "MBOMsg", + "MBP1Msg", + "MBP10Msg", + "Metadata", + "OHLCVMsg", "Packaging", + "Publisher", "ReconnectPolicy", + "RecordFlags", + "Reference", "RollRule", + "SType", "Schema", "SplitDuration", - "StatType", - "SType", - "SymbologyResolution", - # DBN Record Types - "Metadata", - "BBOMsg", - "CBBOMsg", - "ErrorMsg", - "ImbalanceMsg", - "InstrumentDefMsg", - "MBOMsg", - "MBP1Msg", - "MBP10Msg", - "OHLCVMsg", "StatMsg", + "StatType", "StatusMsg", "SymbolMappingMsg", + "SymbologyResolution", "SystemMsg", "TradeMsg", + "Venue", ] # Setup logging diff --git a/databento/common/dbnstore.py b/databento/common/dbnstore.py index 117dad1c..ec3839e9 100644 --- a/databento/common/dbnstore.py +++ b/databento/common/dbnstore.py @@ -1331,7 +1331,7 @@ def __init__( count: int | None = None, ) -> None: self._reader = reader - self._dtype = np.dtype(dtype) + self._dtype: np.typing.DTypeLike = np.dtype(dtype) self._offset = offset self._count = count self._close_on_next = False diff --git a/databento/historical/api/batch.py b/databento/historical/api/batch.py index e75ece82..47782727 100644 --- a/databento/historical/api/batch.py +++ b/databento/historical/api/batch.py @@ -27,9 +27,7 @@ from databento.common import API_VERSION from databento.common.constants import HTTP_STREAMING_READ_SIZE from databento.common.enums import Delivery -from databento.common.enums import Packaging from databento.common.enums import SplitDuration -from databento.common.error import BentoDeprecationWarning from databento.common.error import BentoError from databento.common.error import BentoHttpError from databento.common.error import BentoWarning @@ -40,7 +38,6 @@ from databento.common.parsing import optional_values_list_to_string from databento.common.parsing import symbols_list_to_list from databento.common.publishers import Dataset -from databento.common.types import Default from databento.common.validation import validate_enum from databento.common.validation import validate_path from databento.common.validation import validate_semantic_string @@ -75,7 +72,6 @@ def submit_job( split_symbols: bool = False, split_duration: SplitDuration | str = "day", split_size: int | None = None, - packaging: Packaging | str | None = Default(None), # type: ignore [assignment] delivery: Delivery | str = "download", stype_in: SType | str = "raw_symbol", stype_out: SType | str = "instrument_id", @@ -127,8 +123,6 @@ def submit_job( split_size : int, optional The maximum size (bytes) of each batched data file before being split. Must be an integer between 1e9 and 10e9 inclusive (1GB - 10GB). - packaging : Packaging or str {'none', 'zip', 'tar'}, optional - The archive type to package all batched data files in. delivery : Delivery or str {'download', 's3', 'disk'}, default 'download' The delivery mechanism for the processed batched data files. stype_in : SType or str, default 'raw_symbol' @@ -151,14 +145,6 @@ def submit_job( stype_in_valid = validate_enum(stype_in, SType, "stype_in") symbols_list = symbols_list_to_list(symbols, stype_in_valid) - if isinstance(packaging, Default): - packaging = packaging.value - else: - warnings.warn( - message="The `packaging` parameter is deprecated and will be removed in a future release.", - category=BentoDeprecationWarning, - ) - data: dict[str, object | None] = { "dataset": validate_semantic_string(dataset, "dataset"), "start": datetime_to_string(start), @@ -178,9 +164,6 @@ def submit_job( "split_duration": str( validate_enum(split_duration, SplitDuration, "split_duration"), ), - "packaging": ( - str(validate_enum(packaging, Packaging, "packaging")) if packaging else None - ), "delivery": str(validate_enum(delivery, Delivery, "delivery")), } diff --git a/databento/version.py b/databento/version.py index 4d8afa5b..6f709872 100644 --- a/databento/version.py +++ b/databento/version.py @@ -1 +1 @@ -__version__ = "0.45.0" +__version__ = "0.46.0" diff --git a/pyproject.toml b/pyproject.toml index bb6f54ec..fe3a2765 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "databento" -version = "0.45.0" +version = "0.46.0" description = "Official Python client library for Databento" authors = [ "Databento ", @@ -32,7 +32,7 @@ aiohttp = [ {version = "^3.8.3", python = "<3.12"}, {version = "^3.9.0", python = "^3.12"} ] -databento-dbn = "0.23.1" +databento-dbn = "0.24.0" numpy = [ {version = ">=1.23.5", python = "<3.12"}, {version = ">=1.26.0", python = "^3.12"} @@ -73,6 +73,7 @@ no_strict_optional = true warn_no_return = true warn_unused_configs = true warn_unused_ignores = true +plugins = ["numpy.typing.mypy_plugin"] [tool.pytest.ini_options] testpaths = ["tests"] diff --git a/scripts/lint.sh b/scripts/lint.sh index 50165e01..1b24336e 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -1,4 +1,3 @@ #!/usr/bin/env bash -echo $(mypy --version) -echo Running mypy... -poetry run mypy databento examples tests +echo "Running $(poetry run mypy --version)..." +poetry run mypy . diff --git a/tests/test_historical_batch.py b/tests/test_historical_batch.py index 4bb2584d..d91212ef 100644 --- a/tests/test_historical_batch.py +++ b/tests/test_historical_batch.py @@ -5,7 +5,6 @@ import databento as db import pytest import requests -from databento.common.error import BentoDeprecationWarning from databento.historical.client import Historical @@ -64,20 +63,18 @@ def test_batch_submit_job_sends_expected_request( monkeypatch.setattr(requests, "post", mocked_post := MagicMock()) # Act - with pytest.warns(BentoDeprecationWarning): - historical_client.batch.submit_job( - dataset="GLBX.MDP3", - symbols="ESH1", - schema="trades", - start="2020-12-28T12:00", - end="2020-12-29", - encoding="csv", - split_duration="day", - split_size=10000000000, - packaging="none", - delivery="download", - compression="zstd", - ) + historical_client.batch.submit_job( + dataset="GLBX.MDP3", + symbols="ESH1", + schema="trades", + start="2020-12-28T12:00", + end="2020-12-29", + encoding="csv", + split_duration="day", + split_size=10000000000, + delivery="download", + compression="zstd", + ) # Assert call = mocked_post.call_args.kwargs @@ -100,7 +97,6 @@ def test_batch_submit_job_sends_expected_request( "map_symbols": False, "split_symbols": False, "split_duration": "day", - "packaging": "none", "delivery": "download", "split_size": "10000000000", }