From e3673c0435d67b320ab34af2e56c4988f7bee43d Mon Sep 17 00:00:00 2001 From: Rob Maierle Date: Fri, 30 May 2025 08:42:15 -0400 Subject: [PATCH 1/4] MOD: Fix get_dataset_condition --- CHANGELOG.md | 5 +++++ databento/common/parsing.py | 29 +++++++++++++++++++++++---- databento/historical/api/symbology.py | 4 ++-- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa9602fe..80f8e64f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.57.0 - TBD + +#### Deprecations +- Deprecated `int` and `pd.Timestamp` types for `start_date` and `end_date` parameters which will be removed in v0.59.0 + ## 0.56.0 - 2025-06-03 #### Breaking changes diff --git a/databento/common/parsing.py b/databento/common/parsing.py index b6424746..40fa5cde 100644 --- a/databento/common/parsing.py +++ b/databento/common/parsing.py @@ -1,5 +1,6 @@ from __future__ import annotations +import warnings from collections.abc import Iterable from datetime import date from datetime import datetime @@ -220,7 +221,7 @@ def optional_date_to_string(value: date | str | None) -> str | None: if value is None: return None - return datetime_to_date_string(value) + return date_to_string(value) def datetime_to_string(value: pd.Timestamp | datetime | date | str | int) -> str: @@ -249,7 +250,7 @@ def datetime_to_string(value: pd.Timestamp | datetime | date | str | int) -> str return pd.to_datetime(value).isoformat() -def datetime_to_date_string(value: pd.Timestamp | date | str | int) -> str: +def date_to_string(value: pd.Timestamp | date | str | int) -> str: """ Return a valid date string from the given value. @@ -265,11 +266,31 @@ def datetime_to_date_string(value: pd.Timestamp | date | str | int) -> str: """ if isinstance(value, str): return value - elif isinstance(value, int): - return str(value) elif isinstance(value, date): return value.isoformat() + elif isinstance(value, int): + warnings.warn( + "Passing an int to `start_date` or `end_date` is deprecated and will be removed in v0.59.0." + "Use a date or str instead.", + DeprecationWarning, + stacklevel=2, + ) + return str(value) + elif isinstance(value, pd.Timestamp): + warnings.warn( + "Passing a pandas Timestamp to `start_date` or `end_date` is deprecated and will be removed in v0.59.0." + "Use a date or str instead.", + DeprecationWarning, + stacklevel=2, + ) + return pd.to_datetime(value).date().isoformat() else: + warnings.warn( + f"Passing a {type(value)} to `start_date` or `end_date` is deprecated and will be removed in v0.59.0." + "Use a date or str instead.", + DeprecationWarning, + stacklevel=2, + ) return pd.to_datetime(value).date().isoformat() diff --git a/databento/historical/api/symbology.py b/databento/historical/api/symbology.py index b88fb891..4f8eea68 100644 --- a/databento/historical/api/symbology.py +++ b/databento/historical/api/symbology.py @@ -9,7 +9,7 @@ from databento.common import API_VERSION from databento.common.http import BentoHttpAPI -from databento.common.parsing import datetime_to_date_string +from databento.common.parsing import date_to_string from databento.common.parsing import optional_date_to_string from databento.common.parsing import optional_symbols_list_to_list from databento.common.publishers import Dataset @@ -69,7 +69,7 @@ def resolve( "symbols": ",".join(symbols_list), "stype_in": str(stype_in_valid), "stype_out": str(validate_enum(stype_out, SType, "stype_out")), - "start_date": datetime_to_date_string(start_date), + "start_date": date_to_string(start_date), "end_date": optional_date_to_string(end_date), } From 6e059f99797caaed18d3af92c45a21db0f3902ad Mon Sep 17 00:00:00 2001 From: Nick Macholl Date: Tue, 10 Jun 2025 10:32:25 -0700 Subject: [PATCH 2/4] FIX: Fix DBNStore reader to read across zstd frame --- CHANGELOG.md | 7 +++++-- databento/common/dbnstore.py | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80f8e64f..fd270760 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,12 @@ # Changelog -## 0.57.0 - TBD +## 0.56.1 - TBD #### Deprecations -- Deprecated `int` and `pd.Timestamp` types for `start_date` and `end_date` parameters which will be removed in v0.59.0 +- Deprecated `int` and `pd.Timestamp` types for `start_date` and `end_date` parameters which will be removed in a future release + +#### Bug fixes +- Fixed an issue where the zstandard frame size could limit the size of `DataFrame` objects returned by `DBNStore.to_df()` when a `count` was specified ## 0.56.0 - 2025-06-03 diff --git a/databento/common/dbnstore.py b/databento/common/dbnstore.py index c2c13341..14242ec2 100644 --- a/databento/common/dbnstore.py +++ b/databento/common/dbnstore.py @@ -535,6 +535,7 @@ def reader(self) -> IO[bytes]: if self.compression == Compression.ZSTD: return zstandard.ZstdDecompressor().stream_reader( self._data_source.reader, + read_across_frames=True, ) return self._data_source.reader From e928862be5de15a6e1421dbb870696f7e0f79c9a Mon Sep 17 00:00:00 2001 From: Nick Macholl Date: Tue, 10 Jun 2025 12:13:17 -0700 Subject: [PATCH 3/4] MOD: Upgrade databento_dbn version to 0.36.0 --- CHANGELOG.md | 10 +++++++--- pyproject.toml | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd270760..35bdfe9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,17 @@ # Changelog -## 0.56.1 - TBD +## 0.57.0 - TBD -#### Deprecations -- Deprecated `int` and `pd.Timestamp` types for `start_date` and `end_date` parameters which will be removed in a future release +#### Enhancements +- Upgraded `databento-dbn` to 0.36.0 + - Added missing Python type stubs for several leg properties of `InstrumentDefMsg` #### Bug fixes - Fixed an issue where the zstandard frame size could limit the size of `DataFrame` objects returned by `DBNStore.to_df()` when a `count` was specified +#### Deprecations +- Deprecated `int` and `pd.Timestamp` types for `start_date` and `end_date` parameters which will be removed in a future release + ## 0.56.0 - 2025-06-03 #### Breaking changes diff --git a/pyproject.toml b/pyproject.toml index f0638913..6996f440 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ aiohttp = [ {version = "^3.8.3", python = "<3.12"}, {version = "^3.9.0", python = "^3.12"} ] -databento-dbn = "0.35.1" +databento-dbn = "0.36.0" numpy = [ {version = ">=1.23.5", python = "<3.12"}, {version = ">=1.26.0", python = "^3.12"} From b4c695129ae7d033075e2f7bf099a12da64e2481 Mon Sep 17 00:00:00 2001 From: Nick Macholl Date: Tue, 10 Jun 2025 12:26:23 -0700 Subject: [PATCH 4/4] VER: Release 0.57.0 --- CHANGELOG.md | 2 +- databento/version.py | 2 +- pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35bdfe9b..8c2cdcd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 0.57.0 - TBD +## 0.57.0 - 2025-06-10 #### Enhancements - Upgraded `databento-dbn` to 0.36.0 diff --git a/databento/version.py b/databento/version.py index 9dc81165..6e6e624c 100644 --- a/databento/version.py +++ b/databento/version.py @@ -1 +1 @@ -__version__ = "0.56.0" +__version__ = "0.57.0" diff --git a/pyproject.toml b/pyproject.toml index 6996f440..4ef4ff31 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "databento" -version = "0.56.0" +version = "0.57.0" description = "Official Python client library for Databento" authors = [ "Databento ",