edgarrmondragon opened a new pull request, #998:
URL: https://github.com/apache/arrow-nanoarrow/pull/998
Adds support for iterating map arrays:
```python
# mre_map.py
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "nanoarrow",
# "pyarrow",
# ]
# ///
"""Iterating a map array with nanoarrow fails."""
import nanoarrow as na
import pyarrow as pa
array = pa.array(
[[("a", 1), ("b", None)], [], None, [("c", 3)]],
type=pa.map_(pa.string(), pa.int64()),
)
print(f"nanoarrow {na.__version__}, pyarrow {pa.__version__}")
print(na.Array(array).to_pylist())
```
Run it with `uv run --no-project mre_map.py`. The output is:
```
nanoarrow 0.9.0, pyarrow 26.0.0
...
File ".../nanoarrow/iterator.py", line 231, in _iter_chunk
raise KeyError(
f"Can't resolve iterator for type '{self._schema_view.type}'"
)
KeyError: "Can't resolve iterator for type 'map'"
```
--
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]