Skip to content

Commit 9090bdd

Browse files
authored
VER: Release 0.24.1
See release notes.
2 parents 96fabd2 + 655af52 commit 9090bdd

File tree

7 files changed

+43
-25
lines changed

7 files changed

+43
-25
lines changed

CHANGELOG.md

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

3+
## 0.24.1 - 2023-12-15
4+
5+
##### Enhancements
6+
- Added new publisher value for OPRA MIAX Sapphire
7+
8+
#### Bug fixes
9+
- Fixed issue where a large unreadable symbol subscription message could be sent
10+
- Fixed issue where calling `Live.stop` could cause a truncated DBN record to be written to a stream
11+
312
## 0.24.0 - 2023-11-23
413

514
This release adds support for DBN v2 as well as Python v3.12.

databento/common/publishers.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ class Venue(StringyMixin, str, Enum):
9797
ICE Endex.
9898
DBEQ
9999
Databento Equities - Consolidated.
100+
SPHR
101+
MIAX Sapphire.
100102
101103
"""
102104

@@ -140,6 +142,7 @@ class Venue(StringyMixin, str, Enum):
140142
IFEU = "IFEU"
141143
NDEX = "NDEX"
142144
DBEQ = "DBEQ"
145+
SPHR = "SPHR"
143146

144147
@classmethod
145148
def from_int(cls, value: int) -> Venue:
@@ -226,6 +229,8 @@ def from_int(cls, value: int) -> Venue:
226229
return Venue.NDEX
227230
if value == 40:
228231
return Venue.DBEQ
232+
if value == 41:
233+
return Venue.SPHR
229234
raise ValueError(f"Integer value {value} does not correspond with any Venue variant")
230235

231236
def to_int(self) -> int:
@@ -312,6 +317,8 @@ def to_int(self) -> int:
312317
return 39
313318
if self == Venue.DBEQ:
314319
return 40
320+
if self == Venue.SPHR:
321+
return 41
315322
raise ValueError("Invalid Venue")
316323

317324
@property
@@ -399,6 +406,8 @@ def description(self) -> str:
399406
return "ICE Endex"
400407
if self == Venue.DBEQ:
401408
return "Databento Equities - Consolidated"
409+
if self == Venue.SPHR:
410+
return "MIAX Sapphire"
402411
raise ValueError("Unexpected Venue value")
403412

404413
@unique
@@ -818,6 +827,8 @@ class Publisher(StringyMixin, str, Enum):
818827
DBEQ Basic - Consolidated.
819828
DBEQ_PLUS_DBEQ
820829
DBEQ Plus - Consolidated.
830+
OPRA_PILLAR_SPHR
831+
OPRA - MIAX Sapphire.
821832
822833
"""
823834

@@ -881,6 +892,7 @@ class Publisher(StringyMixin, str, Enum):
881892
NDEX_IMPACT_NDEX = "NDEX.IMPACT.NDEX"
882893
DBEQ_BASIC_DBEQ = "DBEQ.BASIC.DBEQ"
883894
DBEQ_PLUS_DBEQ = "DBEQ.PLUS.DBEQ"
895+
OPRA_PILLAR_SPHR = "OPRA.PILLAR.SPHR"
884896

885897
@classmethod
886898
def from_int(cls, value: int) -> Publisher:
@@ -1007,6 +1019,8 @@ def from_int(cls, value: int) -> Publisher:
10071019
return Publisher.DBEQ_BASIC_DBEQ
10081020
if value == 60:
10091021
return Publisher.DBEQ_PLUS_DBEQ
1022+
if value == 61:
1023+
return Publisher.OPRA_PILLAR_SPHR
10101024
raise ValueError(f"Integer value {value} does not correspond with any Publisher variant")
10111025

10121026
def to_int(self) -> int:
@@ -1133,6 +1147,8 @@ def to_int(self) -> int:
11331147
return 59
11341148
if self == Publisher.DBEQ_PLUS_DBEQ:
11351149
return 60
1150+
if self == Publisher.OPRA_PILLAR_SPHR:
1151+
return 61
11361152
raise ValueError("Invalid Publisher")
11371153
@property
11381154
def venue(self) -> Venue:
@@ -1259,6 +1275,8 @@ def venue(self) -> Venue:
12591275
return Venue.DBEQ
12601276
if self == Publisher.DBEQ_PLUS_DBEQ:
12611277
return Venue.DBEQ
1278+
if self == Publisher.OPRA_PILLAR_SPHR:
1279+
return Venue.SPHR
12621280
raise ValueError("Unexpected Publisher value")
12631281
@property
12641282
def dataset(self) -> Dataset:
@@ -1385,6 +1403,8 @@ def dataset(self) -> Dataset:
13851403
return Dataset.DBEQ_BASIC
13861404
if self == Publisher.DBEQ_PLUS_DBEQ:
13871405
return Dataset.DBEQ_PLUS
1406+
if self == Publisher.OPRA_PILLAR_SPHR:
1407+
return Dataset.OPRA_PILLAR
13881408
raise ValueError("Unexpected Publisher value")
13891409

13901410
@property
@@ -1512,4 +1532,6 @@ def description(self) -> str:
15121532
return "DBEQ Basic - Consolidated"
15131533
if self == Publisher.DBEQ_PLUS_DBEQ:
15141534
return "DBEQ Plus - Consolidated"
1535+
if self == Publisher.OPRA_PILLAR_SPHR:
1536+
return "OPRA - MIAX Sapphire"
15151537
raise ValueError("Unexpected Publisher value")

databento/live/protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434

3535
RECV_BUFFER_SIZE: Final = 64 * 2**10 # 64kb
36-
SYMBOL_LIST_BATCH_SIZE: Final = 64
36+
SYMBOL_LIST_BATCH_SIZE: Final = 32
3737

3838
logger = logging.getLogger(__name__)
3939

databento/live/session.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,8 @@ def close(self) -> None:
328328
return
329329
if self._transport.can_write_eof():
330330
self._loop.call_soon_threadsafe(self._transport.write_eof)
331-
self._loop.call_soon_threadsafe(self._transport.close)
331+
else:
332+
self._loop.call_soon_threadsafe(self._transport.close)
332333

333334
def subscribe(
334335
self,

databento/version.py

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

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "databento"
3-
version = "0.24.0"
3+
version = "0.24.1"
44
description = "Official Python client library for Databento"
55
authors = [
66
"Databento <[email protected]>",

tests/test_live_client.py

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -427,27 +427,13 @@ async def test_live_subscribe_large_symbol_list(
427427
symbols=large_symbol_list,
428428
)
429429

430-
first_message = mock_live_server.get_message_of_type(
431-
gateway.SubscriptionRequest,
432-
timeout=1,
433-
).symbols.split(",")
434-
435-
second_message = mock_live_server.get_message_of_type(
436-
gateway.SubscriptionRequest,
437-
timeout=1,
438-
).symbols.split(",")
439-
440-
third_message = mock_live_server.get_message_of_type(
441-
gateway.SubscriptionRequest,
442-
timeout=1,
443-
).symbols.split(",")
444-
445-
fourth_message = mock_live_server.get_message_of_type(
446-
gateway.SubscriptionRequest,
447-
timeout=1,
448-
).symbols.split(",")
449-
450-
reconstructed = first_message + second_message + third_message + fourth_message
430+
reconstructed: list[str] = []
431+
for _ in range(8):
432+
message = mock_live_server.get_message_of_type(
433+
gateway.SubscriptionRequest,
434+
timeout=1,
435+
).symbols.split(",")
436+
reconstructed.extend(message)
451437

452438
# Assert
453439
assert reconstructed == large_symbol_list

0 commit comments

Comments
 (0)