Skip to content

Commit 5490b1e

Browse files
authored
Fix timestamp corruption with pyarrow 13 and over (#665)
1 parent d7ccb94 commit 5490b1e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clients/py/v3io_frames/pbutils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ def series2col_with_dtype(s, name, dtype):
241241
elif dtype == fpb.TIME:
242242
s = pd.to_datetime(s, utc=True)
243243
s = s.dt.tz_convert('UTC')
244-
kw['times'] = s.astype(np.int64)
244+
# ML-6855: this results in nanoseconds regardless of datetime granularity, unlike s.astype(np.int64)
245+
kw['times'] = s.apply(lambda x: x.value)
245246
kw['dtype'] = fpb.TIME
246247
elif dtype == fpb.NULL:
247248
kw['dtype'] = fpb.NULL

0 commit comments

Comments
 (0)