Cannot create Table with Array of Timestamp type #458
|
I'm trying to avoid pyarrow (due to it's size) and use arro3, but creating a Table with datetime objects doesn't seem to work yet: from datetime import datetime, timezone
from arro3.core import Array, DataType, Table
a = Array([datetime.now(tz=timezone.utc)], type=DataType.timestamp("ns", tz="UTC"))
table = Table.from_pydict({"dt": a})will raise the error: So it seems it's not implemented yet. But reading data with timestamps from disk (created using pyarrow) works just fine. So I was wondering if there are any workarounds? |
Replies: 1 comment 2 replies
|
It's not the table; it's the array. This line fails:
It's true, right now in the array constructor, we support primitive, binary, and string types only: Lines 215 to 286 in b9985f2 We've implemented the reverse direction now, going from Arrow to Python datetime objects, but we need to also implement the reverse of going from Python datetime objects into an Arrow array. Let's move this into an issue instead of a discussion. If you're interested in contributing I can give you some pointers. |
It's not the table; it's the array. This line fails:
It's true, right now in the array constructor, we support primitive, binary, and string types only:
arro3/pyo3-arrow/src/array.rs
Lines 215 to 286 in b9985f2