Skip to content

Commit

Permalink
DEL: Remove pretty_px option from DBNStore.to_df
Browse files Browse the repository at this point in the history
  • Loading branch information
nmacholl committed Jan 8, 2024
1 parent d04a57b commit 779c0ef
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 26 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog

## 0.24.2 - TBD
## 0.25.0 - TBD

#### Breaking changes
- Removed deprecated `pretty_px` parameter for `DBNStore.to_df`; `price_type` can be used instead

#### Bug fixes
- Fixed an issue where the `Live` client would not raise an exception when reading an incompatible DBN version
Expand Down
23 changes: 0 additions & 23 deletions databento/common/dbnstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import decimal
import itertools
import logging
import warnings
from collections.abc import Generator
from collections.abc import Iterator
from io import BytesIO
Expand Down Expand Up @@ -826,7 +825,6 @@ def to_csv(
@overload
def to_df(
self,
pretty_px: bool | None = ...,
price_type: Literal["fixed", "float", "decimal"] = ...,
pretty_ts: bool = ...,
map_symbols: bool = ...,
Expand All @@ -838,7 +836,6 @@ def to_df(
@overload
def to_df(
self,
pretty_px: bool | None = ...,
price_type: Literal["fixed", "float", "decimal"] = ...,
pretty_ts: bool = ...,
map_symbols: bool = ...,
Expand All @@ -849,7 +846,6 @@ def to_df(

def to_df(
self,
pretty_px: bool | None = None,
price_type: Literal["fixed", "float", "decimal"] = "float",
pretty_ts: bool = True,
map_symbols: bool = True,
Expand All @@ -861,11 +857,6 @@ def to_df(
Parameters
----------
pretty_px : bool, default True
This parameter is deprecated and will be removed in a future release.
If all price columns should be converted from `int` to `float` at
the correct scale (using the fixed-precision scalar 1e-9). Null
prices are replaced with NaN.
price_type : str, default "float"
The price type to use for price fields.
If "fixed", prices will have a type of `int` in fixed decimal format; each unit representing 1e-9 or 0.000000001.
Expand Down Expand Up @@ -899,20 +890,6 @@ def to_df(
If the schema for the array cannot be determined.
"""
if pretty_px is True:
warnings.warn(
'The argument `pretty_px` is deprecated and will be removed in a future release; `price_type="float"` can be used instead.',
DeprecationWarning,
stacklevel=2,
)
elif pretty_px is False:
price_type = "fixed"
warnings.warn(
'The argument `pretty_px` is deprecated and will be removed in a future release; `price_type="fixed"` can be used instead.',
DeprecationWarning,
stacklevel=2,
)

schema = validate_maybe_enum(schema, Schema, "schema")
if schema is None:
if self.schema is None:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_historical_bento.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def test_to_df_with_mbo_data_returns_expected_record(
# Act
df = data.to_df(
pretty_ts=False,
pretty_px=False,
price_type="fixed",
map_symbols=False,
)

Expand Down Expand Up @@ -324,7 +324,7 @@ def test_to_df_with_stub_ohlcv_data_returns_expected_record(
# Act
df = data.to_df(
pretty_ts=False,
pretty_px=False,
price_type="fixed",
map_symbols=False,
)

Expand Down

0 comments on commit 779c0ef

Please sign in to comment.