SamuelMarks opened a new issue, #37322:
URL: https://github.com/apache/arrow/issues/37322
### Describe the usage question you have. Please include as many useful
details as possible.
Attempt:
```py
import pyarrow as pa
# Explicit schema definition to try and resolve error
schema = pa.schema(
[
pa.field("timestamp_col", pa.timestamp("ns", tz="UTC")),
pa.field("json_col", pa.struct([("can", pa.string())])),
pa.field("array_str_col", pa.list_(pa.string())),
pa.field("array_bigint_col", pa.list_(pa.int64())),
pa.field(
"array_json_col",
pa.list_(pa.struct([("foo", pa.string()), ("can",
pa.string())])),
),
]
)
row = pa.Table.from_pydict(
{
"timestamp_col": datetime.now().isoformat(),
"json_col": {"can": "haz"},
"array_str_col": ["Flamingo", "Centipede"],
"array_bigint_col": np.arange(6, dtype=np.int64),
"array_json_col": [{"foo": "bar"}, {"can": "haz"}],
},
schema=schema,
)
```
(for more experiments—including Parquet and a `pandas` variant of the above
mock—see
https://github.com/offscale/cdd-python-gae/blob/704e8df/cdd_gae/tests/test_parquet_to_table.py#L259
)
Error:
```py
row = pa.Table.from_pydict(
^^^^^^^^^^^^^^^^^^^^^
File "pyarrow/table.pxi", line 3849, in pyarrow.lib.Table.from_pydict
File "pyarrow/table.pxi", line 5418, in pyarrow.lib._from_pydict
File "pyarrow/array.pxi", line 357, in pyarrow.lib.asarray
File "pyarrow/array.pxi", line 327, in pyarrow.lib.array
File "pyarrow/array.pxi", line 39, in pyarrow.lib._sequence_to_array
File "pyarrow/error.pxi", line 144, in
pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 123, in pyarrow.lib.check_status
pyarrow.lib.ArrowTypeError: object of type <class 'str'> cannot be converted
to int
```
### Component(s)
Python
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]