Skip to content

Commit d073957

Browse files
authored
VER: Release 0.45.0
See release notes.
2 parents e6ea548 + 10f25ca commit d073957

File tree

10 files changed

+83
-22
lines changed

10 files changed

+83
-22
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
os: [ubuntu-latest, macos-latest, windows-latest]
13-
python-version: ["3.9", "3.10", "3.11", "3.12"]
13+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1414
name: build - Python ${{ matrix.python-version }} (${{ matrix.os }})
1515
runs-on: ${{ matrix.os }}
1616

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## 0.45.0 - 2024-11-12
4+
5+
This release adds support for Python v3.13.
6+
7+
#### Enhancements
8+
- Added support for Python 3.13
9+
- Added new IntelligentCross venues `ASPN`, `ASMT`, and `ASPI`
10+
- Upgraded `databento-dbn` to 0.23.1
11+
- Fixed `pretty_activation` getter in `databento_dbn` returning `expiration` instead
12+
- Fixed some `pretty_` getters in `databento_dbn` didn't correctly handle `UNDEF_PRICE`
13+
14+
#### Deprecations
15+
- Deprecated `packaging` parameter for `Historical.batch.submit_job` which will be removed in a future release
16+
317
## 0.44.1 - 2024-10-29
418

519
#### Enhancements

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The library is fully compatible with the latest distribution of Anaconda 3.9 and
3232
The minimum dependencies as found in the `pyproject.toml` are also listed below:
3333
- python = "^3.9"
3434
- aiohttp = "^3.8.3"
35-
- databento-dbn = "0.23.0"
35+
- databento-dbn = "0.23.1"
3636
- numpy= ">=1.23.5"
3737
- pandas = ">=1.5.3"
3838
- pip-system-certs = ">=4.0" (Windows only)

databento/common/publishers.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ class Venue(StringyMixin, str, Enum):
102102
Long-Term Stock Exchange, Inc..
103103
XOFF
104104
Off-Exchange Transactions - Listed Instruments.
105+
ASPN
106+
IntelligentCross ASPEN Intelligent Bid/Offer.
107+
ASMT
108+
IntelligentCross ASPEN Maker/Taker.
109+
ASPI
110+
IntelligentCross ASPEN Inverted.
105111
106112
"""
107113

@@ -148,6 +154,9 @@ class Venue(StringyMixin, str, Enum):
148154
SPHR = "SPHR"
149155
LTSE = "LTSE"
150156
XOFF = "XOFF"
157+
ASPN = "ASPN"
158+
ASMT = "ASMT"
159+
ASPI = "ASPI"
151160

152161
@classmethod
153162
def from_int(cls, value: int) -> Venue:
@@ -240,6 +249,12 @@ def from_int(cls, value: int) -> Venue:
240249
return Venue.LTSE
241250
if value == 43:
242251
return Venue.XOFF
252+
if value == 44:
253+
return Venue.ASPN
254+
if value == 45:
255+
return Venue.ASMT
256+
if value == 46:
257+
return Venue.ASPI
243258
raise ValueError(f"Integer value {value} does not correspond with any Venue variant")
244259

245260
def to_int(self) -> int:
@@ -332,6 +347,12 @@ def to_int(self) -> int:
332347
return 42
333348
if self == Venue.XOFF:
334349
return 43
350+
if self == Venue.ASPN:
351+
return 44
352+
if self == Venue.ASMT:
353+
return 45
354+
if self == Venue.ASPI:
355+
return 46
335356
raise ValueError("Invalid Venue")
336357

337358
@property
@@ -425,6 +446,12 @@ def description(self) -> str:
425446
return "Long-Term Stock Exchange, Inc."
426447
if self == Venue.XOFF:
427448
return "Off-Exchange Transactions - Listed Instruments"
449+
if self == Venue.ASPN:
450+
return "IntelligentCross ASPEN Intelligent Bid/Offer"
451+
if self == Venue.ASMT:
452+
return "IntelligentCross ASPEN Maker/Taker"
453+
if self == Venue.ASPI:
454+
return "IntelligentCross ASPEN Inverted"
428455
raise ValueError("Unexpected Venue value")
429456

430457

databento/historical/api/batch.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
from databento.common.enums import Delivery
3030
from databento.common.enums import Packaging
3131
from databento.common.enums import SplitDuration
32+
from databento.common.error import BentoDeprecationWarning
3233
from databento.common.error import BentoError
3334
from databento.common.error import BentoHttpError
3435
from databento.common.error import BentoWarning
@@ -39,6 +40,7 @@
3940
from databento.common.parsing import optional_values_list_to_string
4041
from databento.common.parsing import symbols_list_to_list
4142
from databento.common.publishers import Dataset
43+
from databento.common.types import Default
4244
from databento.common.validation import validate_enum
4345
from databento.common.validation import validate_path
4446
from databento.common.validation import validate_semantic_string
@@ -73,7 +75,7 @@ def submit_job(
7375
split_symbols: bool = False,
7476
split_duration: SplitDuration | str = "day",
7577
split_size: int | None = None,
76-
packaging: Packaging | str | None = None,
78+
packaging: Packaging | str | None = Default(None), # type: ignore [assignment]
7779
delivery: Delivery | str = "download",
7880
stype_in: SType | str = "raw_symbol",
7981
stype_out: SType | str = "instrument_id",
@@ -148,6 +150,15 @@ def submit_job(
148150
"""
149151
stype_in_valid = validate_enum(stype_in, SType, "stype_in")
150152
symbols_list = symbols_list_to_list(symbols, stype_in_valid)
153+
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+
151162
data: dict[str, object | None] = {
152163
"dataset": validate_semantic_string(dataset, "dataset"),
153164
"start": datetime_to_string(start),

databento/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.44.1"
1+
__version__ = "0.45.0"

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "databento"
3-
version = "0.44.1"
3+
version = "0.45.0"
44
description = "Official Python client library for Databento"
55
authors = [
66
"Databento <support@databento.com>",
@@ -27,12 +27,12 @@ repository = "https://github.com/databento/databento-python"
2727
"Bug Tracker" = "https://github.com/databento/databento-python/issues"
2828

2929
[tool.poetry.dependencies]
30-
python = ">=3.9,<3.13"
30+
python = ">=3.9,<3.14"
3131
aiohttp = [
3232
{version = "^3.8.3", python = "<3.12"},
3333
{version = "^3.9.0", python = "^3.12"}
3434
]
35-
databento-dbn = "0.23.0"
35+
databento-dbn = "0.23.1"
3636
numpy = [
3737
{version = ">=1.23.5", python = "<3.12"},
3838
{version = ">=1.26.0", python = "^3.12"}

tests/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,4 +297,6 @@ async def fixture_live_client(
297297
with mock_live_server.test_context():
298298
yield test_client
299299

300-
test_client.stop()
300+
if test_client.is_connected():
301+
test_client.stop()
302+
await test_client.wait_for_close()

tests/mockliveserver/controller.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ def _command_active_count(self, *_: str) -> None:
9494
"""
9595
Log the number of active connections.
9696
"""
97-
count = self._server._active_count # type: ignore [attr-defined]
97+
# _active_count was removed in Python 3.13
98+
if hasattr(self._server, "_active_count"):
99+
count = self._server._active_count
100+
else:
101+
count = len(self._server._clients) # type: ignore [attr-defined]
102+
98103
logger.info("active connections: %d", count)
99104

100105
def _command_add_key(self, key: str) -> None:

tests/test_historical_batch.py

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

1011

@@ -63,19 +64,20 @@ def test_batch_submit_job_sends_expected_request(
6364
monkeypatch.setattr(requests, "post", mocked_post := MagicMock())
6465

6566
# Act
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-
packaging="none",
76-
delivery="download",
77-
compression="zstd",
78-
)
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+
)
7981

8082
# Assert
8183
call = mocked_post.call_args.kwargs

0 commit comments

Comments
 (0)