Skip to content

Commit

Permalink
fix: avoid out-of-range nanoseconds field in pandas 1.5.x (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
tswast committed Sep 19, 2022
1 parent a361806 commit 2a477ca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion db_dtypes/__init__.py
Expand Up @@ -150,7 +150,8 @@ def _datetime(
hour=int(hour),
minute=int(minute) if minute else 0,
second=int(second) if second else 0,
nanosecond=nanosecond,
microsecond=nanosecond // 1000,
nanosecond=nanosecond % 1000,
).to_datetime64()
else:
raise TypeError("Invalid value type", scalar)
Expand Down

0 comments on commit 2a477ca

Please sign in to comment.