Skip to content

Commit 748b26d

Browse files
committed
DEL: Remove packaging for batch.submit_job
1 parent dbb0ed4 commit 748b26d

File tree

3 files changed

+13
-33
lines changed

3 files changed

+13
-33
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 0.46.0 - TBD
44

55
#### Enhancements
6+
- Removed deprecated `packaging` parameter from `Historical.batch.submit_job`. Job files can be downloaded individually or as zip files after the job completes
67
- Upgraded `databento-dbn` to 0.24.0
78
- Added handling for `UNDEF_TIMESTAMP` in `pretty_` timestamp getters for Python. They now return `None` in the case of `UNDEF_TIMESTAMP`
89

databento/historical/api/batch.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727
from databento.common import API_VERSION
2828
from databento.common.constants import HTTP_STREAMING_READ_SIZE
2929
from databento.common.enums import Delivery
30-
from databento.common.enums import Packaging
3130
from databento.common.enums import SplitDuration
32-
from databento.common.error import BentoDeprecationWarning
3331
from databento.common.error import BentoError
3432
from databento.common.error import BentoHttpError
3533
from databento.common.error import BentoWarning
@@ -40,7 +38,6 @@
4038
from databento.common.parsing import optional_values_list_to_string
4139
from databento.common.parsing import symbols_list_to_list
4240
from databento.common.publishers import Dataset
43-
from databento.common.types import Default
4441
from databento.common.validation import validate_enum
4542
from databento.common.validation import validate_path
4643
from databento.common.validation import validate_semantic_string
@@ -75,7 +72,6 @@ def submit_job(
7572
split_symbols: bool = False,
7673
split_duration: SplitDuration | str = "day",
7774
split_size: int | None = None,
78-
packaging: Packaging | str | None = Default(None), # type: ignore [assignment]
7975
delivery: Delivery | str = "download",
8076
stype_in: SType | str = "raw_symbol",
8177
stype_out: SType | str = "instrument_id",
@@ -127,8 +123,6 @@ def submit_job(
127123
split_size : int, optional
128124
The maximum size (bytes) of each batched data file before being split.
129125
Must be an integer between 1e9 and 10e9 inclusive (1GB - 10GB).
130-
packaging : Packaging or str {'none', 'zip', 'tar'}, optional
131-
The archive type to package all batched data files in.
132126
delivery : Delivery or str {'download', 's3', 'disk'}, default 'download'
133127
The delivery mechanism for the processed batched data files.
134128
stype_in : SType or str, default 'raw_symbol'
@@ -151,14 +145,6 @@ def submit_job(
151145
stype_in_valid = validate_enum(stype_in, SType, "stype_in")
152146
symbols_list = symbols_list_to_list(symbols, stype_in_valid)
153147

154-
if isinstance(packaging, Default):
155-
packaging = packaging.value
156-
else:
157-
warnings.warn(
158-
message="The `packaging` parameter is deprecated and will be removed in a future release.",
159-
category=BentoDeprecationWarning,
160-
)
161-
162148
data: dict[str, object | None] = {
163149
"dataset": validate_semantic_string(dataset, "dataset"),
164150
"start": datetime_to_string(start),
@@ -178,9 +164,6 @@ def submit_job(
178164
"split_duration": str(
179165
validate_enum(split_duration, SplitDuration, "split_duration"),
180166
),
181-
"packaging": (
182-
str(validate_enum(packaging, Packaging, "packaging")) if packaging else None
183-
),
184167
"delivery": str(validate_enum(delivery, Delivery, "delivery")),
185168
}
186169

tests/test_historical_batch.py

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import databento as db
66
import pytest
77
import requests
8-
from databento.common.error import BentoDeprecationWarning
98
from databento.historical.client import Historical
109

1110

@@ -64,20 +63,18 @@ def test_batch_submit_job_sends_expected_request(
6463
monkeypatch.setattr(requests, "post", mocked_post := MagicMock())
6564

6665
# Act
67-
with pytest.warns(BentoDeprecationWarning):
68-
historical_client.batch.submit_job(
69-
dataset="GLBX.MDP3",
70-
symbols="ESH1",
71-
schema="trades",
72-
start="2020-12-28T12:00",
73-
end="2020-12-29",
74-
encoding="csv",
75-
split_duration="day",
76-
split_size=10000000000,
77-
packaging="none",
78-
delivery="download",
79-
compression="zstd",
80-
)
66+
historical_client.batch.submit_job(
67+
dataset="GLBX.MDP3",
68+
symbols="ESH1",
69+
schema="trades",
70+
start="2020-12-28T12:00",
71+
end="2020-12-29",
72+
encoding="csv",
73+
split_duration="day",
74+
split_size=10000000000,
75+
delivery="download",
76+
compression="zstd",
77+
)
8178

8279
# Assert
8380
call = mocked_post.call_args.kwargs
@@ -100,7 +97,6 @@ def test_batch_submit_job_sends_expected_request(
10097
"map_symbols": False,
10198
"split_symbols": False,
10299
"split_duration": "day",
103-
"packaging": "none",
104100
"delivery": "download",
105101
"split_size": "10000000000",
106102
}

0 commit comments

Comments
 (0)