Skip to content

Commit 2a477ca

Browse files
authored
fix: avoid out-of-range nanoseconds field in pandas 1.5.x (#148)
1 parent a361806 commit 2a477ca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

db_dtypes/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ def _datetime(
150150
hour=int(hour),
151151
minute=int(minute) if minute else 0,
152152
second=int(second) if second else 0,
153-
nanosecond=nanosecond,
153+
microsecond=nanosecond // 1000,
154+
nanosecond=nanosecond % 1000,
154155
).to_datetime64()
155156
else:
156157
raise TypeError("Invalid value type", scalar)

0 commit comments

Comments
 (0)