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
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## 0.57.0 - 2025-06-10

#### 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
Expand Down
1 change: 1 addition & 0 deletions databento/common/dbnstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
29 changes: 25 additions & 4 deletions databento/common/parsing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import warnings
from collections.abc import Iterable
from datetime import date
from datetime import datetime
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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.

Expand All @@ -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()


Expand Down
4 changes: 2 additions & 2 deletions databento/historical/api/symbology.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
}

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.56.0"
__version__ = "0.57.0"
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.56.0"
version = "0.57.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.35.1"
databento-dbn = "0.36.0"
numpy = [
{version = ">=1.23.5", python = "<3.12"},
{version = ">=1.26.0", python = "^3.12"}
Expand Down