Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Changelog

## 0.60.0 - 2025-08-05

#### Enhancements
- Added `parquet_schema` option to `DBNStore.to_parquet()` for overriding the pyarrow schema.
- Upgraded `databento-dbn` to 0.39.0
- Added `side()` and `unpaired_side()` methods to `ImbalanceMsg` that convert the fields
of the same name to the `Side` enum
- Added `pretty_auction_time` property in Python for `ImbalanceMsg`
- Added `action` and `ts_in_delta` getters to `BboMsg`
- Added `ts_recv` getter to `StatusMsg`
- Added missing floating-point price getters to `InstrumentDefMsg` record types from all
DBN versions
- Added more floating-point price getters to `ImbalanceMsg`
- Added floating-point price getter to `StatMsg`
- Standardize Python `__init__` type signatures
- Changed `auction_time` field in `ImbalanceMsg` to be formatted as a timestamp
- Fixed a regression where some enum constructors no longer raised a `DBNError` in
Python

#### Bug fixes
- Removed unused `S3` and `Disk` variants from `Delivery` enum

## 0.59.0 - 2025-07-15

#### Enhancements
Expand Down
9 changes: 7 additions & 2 deletions databento/common/dbnstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,7 @@ def to_parquet(
map_symbols: bool = True,
schema: Schema | str | None = None,
mode: Literal["w", "x"] = "w",
parquet_schema: pa.Schema | None = None,
**kwargs: Any,
) -> None:
"""
Expand All @@ -1010,6 +1011,9 @@ def to_parquet(
This is only required when reading a DBN stream with mixed record types.
mode : str, default "w"
The file write mode to use, either "x" or "w".
parquet_schema : pyarrow.Schema, optional
The pyarrow parquet schema to use to write the parquet file.
This defaults to a detected schema based on the DataFrame representation.
**kwargs : Any
Keyword arguments to pass to the `pyarrow.parquet.ParquetWriter`.
These can be used to override the default behavior of the writer.
Expand Down Expand Up @@ -1046,10 +1050,11 @@ def to_parquet(
for frame in dataframe_iter:
if writer is None:
# Initialize the writer using the first DataFrame
parquet_schema = pa.Schema.from_pandas(frame)
if parquet_schema is None:
parquet_schema = pa.Schema.from_pandas(frame)
writer = pq.ParquetWriter(
where=kwargs.pop("where", file_path),
schema=kwargs.pop("schema", parquet_schema),
schema=parquet_schema,
**kwargs,
)
writer.write_table(
Expand Down
2 changes: 0 additions & 2 deletions databento/common/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@ class Delivery(StringyMixin, str, Enum):
"""

DOWNLOAD = "download"
S3 = "s3"
DISK = "disk"


@unique
Expand Down
3 changes: 2 additions & 1 deletion databento/historical/api/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ 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).
delivery : Delivery or str {'download', 's3', 'disk'}, default 'download'
delivery : Delivery or str {'download'}, default 'download'
The delivery mechanism for the processed batched data files.
Only 'download' is supported at this time.
stype_in : SType or str, default 'raw_symbol'
The input symbology type to resolve from.
stype_out : SType or str, default 'instrument_id'
Expand Down
2 changes: 1 addition & 1 deletion databento/live/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class DatabentoLiveProtocol(asyncio.BufferedProtocol):
dataset : Dataset or str
The dataset for authentication.
ts_out : bool, default False
Flag for requesting `ts_out` to be appending to all records in the session.
Flag for requesting `ts_out` to be appended to all records in the session.
heartbeat_interval_s: int, optional
The interval in seconds at which the gateway will send heartbeat records if no
other data records are sent.
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.59.0"
__version__ = "0.60.0"
6 changes: 1 addition & 5 deletions examples/live_smoke_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,14 @@ def run_client_with_snapshot(args: argparse.Namespace) -> None:
print("Starting client...")

for record in client:
if isinstance(record, SymbolMappingMsg):
continue
elif isinstance(record, MBOMsg):
if isinstance(record, MBOMsg):
if record.flags & RecordFlags.F_SNAPSHOT:
received_snapshot_record = True
else:
print(f"Received expected record {record}")
break
elif isinstance(record, ErrorMsg):
raise ValueError(f"Received error {record.err}")
else:
raise ValueError(f"Received unexpected record {record}")

print("Finished client")

Expand Down
4 changes: 2 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.59.0"
version = "0.60.0"
description = "Official Python client library for Databento"
authors = [
"Databento <support@databento.com>",
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.37.1"
databento-dbn = "~=0.39.0"
numpy = [
{version = ">=1.23.5", python = "<3.12"},
{version = ">=1.26.0", python = "^3.12"}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_common_symbology.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def test_instrument_map_insert_symbol_mapping_message_v1(
end_ts=end_date,
)
sym_msg_v1 = SymbolMappingMsgV1(
publisher_id=sym_msg.publisher_id, # type: ignore [call-arg]
publisher_id=sym_msg.publisher_id,
instrument_id=sym_msg.instrument_id,
ts_event=sym_msg.ts_event,
stype_in_symbol=sym_msg.stype_in_symbol,
Expand Down
Loading