diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dd68311..7fa41e22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/databento/common/dbnstore.py b/databento/common/dbnstore.py index 047aef7e..22d435af 100644 --- a/databento/common/dbnstore.py +++ b/databento/common/dbnstore.py @@ -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: """ @@ -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. @@ -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( diff --git a/databento/common/enums.py b/databento/common/enums.py index 3607a0a3..7fd5bd79 100644 --- a/databento/common/enums.py +++ b/databento/common/enums.py @@ -157,8 +157,6 @@ class Delivery(StringyMixin, str, Enum): """ DOWNLOAD = "download" - S3 = "s3" - DISK = "disk" @unique diff --git a/databento/historical/api/batch.py b/databento/historical/api/batch.py index 4a127ff8..70f9dc9e 100644 --- a/databento/historical/api/batch.py +++ b/databento/historical/api/batch.py @@ -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' diff --git a/databento/live/protocol.py b/databento/live/protocol.py index e36db93e..98194ea9 100644 --- a/databento/live/protocol.py +++ b/databento/live/protocol.py @@ -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. diff --git a/databento/version.py b/databento/version.py index 25dbb4bb..5684ec75 100644 --- a/databento/version.py +++ b/databento/version.py @@ -1 +1 @@ -__version__ = "0.59.0" +__version__ = "0.60.0" diff --git a/examples/live_smoke_test.py b/examples/live_smoke_test.py index a68a60fd..5a53ef60 100755 --- a/examples/live_smoke_test.py +++ b/examples/live_smoke_test.py @@ -80,9 +80,7 @@ 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: @@ -90,8 +88,6 @@ def run_client_with_snapshot(args: argparse.Namespace) -> None: break elif isinstance(record, ErrorMsg): raise ValueError(f"Received error {record.err}") - else: - raise ValueError(f"Received unexpected record {record}") print("Finished client") diff --git a/pyproject.toml b/pyproject.toml index b0fe149c..91c03f28 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 ", @@ -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"} diff --git a/tests/test_common_symbology.py b/tests/test_common_symbology.py index aa2d4a2e..027fbeb5 100644 --- a/tests/test_common_symbology.py +++ b/tests/test_common_symbology.py @@ -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,