From 748b26d7435d02700f88c76d4e76694a5cce7df4 Mon Sep 17 00:00:00 2001 From: Nick Macholl Date: Mon, 9 Dec 2024 16:58:26 -0800 Subject: [PATCH] DEL: Remove packaging for batch.submit_job --- CHANGELOG.md | 1 + databento/historical/api/batch.py | 17 ----------------- tests/test_historical_batch.py | 28 ++++++++++++---------------- 3 files changed, 13 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 101f21f..098fb74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 0.46.0 - TBD #### 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` diff --git a/databento/historical/api/batch.py b/databento/historical/api/batch.py index e75ece8..4778272 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/tests/test_historical_batch.py b/tests/test_historical_batch.py index 4bb2584..d91212e 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", }