Skip to content

Commit 745f21d

Browse files
committed
FIX: Performance of DBNStore.to_df with pretty_ts
1 parent 6ea9aec commit 745f21d

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#### Bug fixes
66
- Fixed issue where a large unreadable symbol subscription message could be sent
7+
- Fixed an issue where `DBNStore.to_df` with `pretty_ts=True` was very slow
78

89
## 0.22.1 - 2023-10-24
910

databento/common/dbnstore.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import warnings
88
from collections.abc import Generator
99
from collections.abc import Iterator
10-
from functools import partial
1110
from io import BytesIO
1211
from os import PathLike
1312
from pathlib import Path
@@ -1246,9 +1245,7 @@ def _format_px(
12461245

12471246
def _format_pretty_ts(self, df: pd.DataFrame) -> None:
12481247
for field in self._struct._timestamp_fields:
1249-
df[field] = df[field].apply(
1250-
partial(pd.to_datetime, utc=True, errors="coerce"),
1251-
)
1248+
df[field] = pd.to_datetime(df[field], utc=True, errors="coerce")
12521249

12531250
def _format_set_index(self, df: pd.DataFrame) -> None:
12541251
index_column = (

0 commit comments

Comments
 (0)