oleksandr-yatsuk opened a new issue, #14116:
URL: https://github.com/apache/arrow/issues/14116
Hello guys,
We are trying to write to parquet python dictionaries into `map<string,
string>` column and facing an issue converting them to `pyarrow.Table`
The simple code snippet
```
def test_map_type(self):
from pyarrow import Table
from pyarrow import int64, map_, schema, string, field
tags_updated = {
"id": 1,
"tags": {
"tag1": "value1",
"tag2": "value2",
}
}
pyarrow_schema = schema([
field("id", int64(), False),
field("tags", map_(string(), string()), False)
])
table = Table.from_pylist(mapping=[tags_updated],
schema=pyarrow_schema)
print(table.to_pydict())
```
fails with an error
```
pyarrow/array.pxi:39: in pyarrow.lib._sequence_to_array
???
pyarrow/error.pxi:143: in pyarrow.lib.pyarrow_internal_check_status
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _
> ???
E pyarrow.lib.ArrowTypeError: Could not convert {'tag1': 'value1', 'tag2':
'value2'} with type dict: was not a sequence or recognized null for conversion
to list type
pyarrow/error.pxi:122: ArrowTypeError
```
We are using `pyarrow == 7.0.0`, but id does not work with `pyarrow ==
9.0.0` either
--
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]