Skip to content

Commit

Permalink
fix: improve datetime detection in pandas dataframes
Browse files Browse the repository at this point in the history
  • Loading branch information
juba committed Sep 5, 2024
1 parent 00b7a49 commit 602d2c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pyobsplot/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def pd_to_arrow(df: pd.DataFrame) -> bytes:
"""
# Convert dates to timestamps
for col in df.columns:
if df[col].dtype == "object":
if pd.api.types.is_datetime64_any_dtype(df[col]):
try:
df[col] = pd.to_datetime(df[col])
except ValueError:
Expand Down

0 comments on commit 602d2c1

Please sign in to comment.