Skip to content

Commit

Permalink
VER: Release 0.46.0
Browse files Browse the repository at this point in the history
See release notes.
  • Loading branch information
nmacholl authored Dec 11, 2024
2 parents d073957 + f18c02a commit deb029e
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 61 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
39 changes: 19 additions & 20 deletions databento/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion databento/common/dbnstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
2 changes: 1 addition & 1 deletion databento/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.45.0"
__version__ = "0.46.0"
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
Expand Down Expand Up @@ -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"}
Expand Down Expand Up @@ -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"]
Expand Down
5 changes: 2 additions & 3 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
@@ -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 .
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 deb029e

Please sign in to comment.