Skip to content

Commit

Permalink
DEL: Remove packaging for batch.submit_job
Browse files Browse the repository at this point in the history
  • Loading branch information
nmacholl committed Dec 10, 2024
1 parent dbb0ed4 commit 748b26d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 33 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
17 changes: 0 additions & 17 deletions databento/historical/api/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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'
Expand All @@ -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),
Expand All @@ -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")),
}

Expand Down
28 changes: 12 additions & 16 deletions tests/test_historical_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import databento as db
import pytest
import requests
from databento.common.error import BentoDeprecationWarning
from databento.historical.client import Historical


Expand Down Expand Up @@ -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
Expand All @@ -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",
}
Expand Down

0 comments on commit 748b26d

Please sign in to comment.