jorisvandenbossche opened a new issue, #465:
URL: https://github.com/apache/arrow-nanoarrow/issues/465

   ```
   In [13]: arr = na.array(pa.array([None]))
   
   In [14]: arr.schema
   Out[14]: <Schema> na
   
   In [15]: arr
   Out[15]: 
---------------------------------------------------------------------------
   KeyError                                  Traceback (most recent call last)
   File 
~/conda/envs/arrow-dev/lib/python3.11/site-packages/IPython/core/formatters.py:708,
 in PlainTextFormatter.__call__(self, obj)
       701 stream = StringIO()
       702 printer = pretty.RepresentationPrinter(stream, self.verbose,
       703     self.max_width, self.newline,
       704     max_seq_length=self.max_seq_length,
       705     singleton_pprinters=self.singleton_printers,
       706     type_pprinters=self.type_printers,
       707     deferred_pprinters=self.deferred_printers)
   --> 708 printer.pretty(obj)
       709 printer.flush()
       710 return stream.getvalue()
   
   File 
~/conda/envs/arrow-dev/lib/python3.11/site-packages/IPython/lib/pretty.py:410, 
in RepresentationPrinter.pretty(self, obj)
       407                         return meth(obj, self, cycle)
       408                 if cls is not object \
       409                         and callable(cls.__dict__.get('__repr__')):
   --> 410                     return _repr_pprint(obj, self, cycle)
       412     return _default_pprint(obj, self, cycle)
       413 finally:
   
   File 
~/conda/envs/arrow-dev/lib/python3.11/site-packages/IPython/lib/pretty.py:778, 
in _repr_pprint(obj, p, cycle)
       776 """A pprint that just redirects to the normal repr function."""
       777 # Find newlines and replace them with p.break_()
   --> 778 output = repr(obj)
       779 lines = output.splitlines()
       780 with p.group():
   
   File ~/scipy/repos/arrow-nanoarrow/python/src/nanoarrow/array.py:614, in 
Array.__repr__(self)
       613 def __repr__(self) -> str:
   --> 614     return self.to_string()
   
   File ~/scipy/repos/arrow-nanoarrow/python/src/nanoarrow/array.py:597, in 
Array.to_string(self, width_hint, items_hint)
       588 schema_repr = _schema_repr(
       589     self.schema,
       590     max_char_width=width_hint - len(cls_name) - len(len_text) - 2,
       591     prefix="",
       592     include_metadata=False,
       593 )
       595 lines = [f"{cls_name}<{schema_repr}>{len_text}"]
   --> 597 for i, item in enumerate(self.iter_py()):
       598     if i >= items_hint:
       599         break
   
   File ~/scipy/repos/arrow-nanoarrow/python/src/nanoarrow/iterator.py:184, in 
PyIterator.get_iterator(cls, obj, schema)
       182 for array in stream:
       183     iterator._set_array(array)
   --> 184     yield from iterator
   
   File ~/scipy/repos/arrow-nanoarrow/python/src/nanoarrow/iterator.py:209, in 
PyIterator.__iter__(self)
       207 def __iter__(self):
       208     """Iterate over all elements in the current chunk"""
   --> 209     return self._iter_chunk(0, len(self._array_view))
   
   File ~/scipy/repos/arrow-nanoarrow/python/src/nanoarrow/iterator.py:226, in 
PyIterator._iter_chunk(self, offset, length)
       224 type_id = self._schema_view.type_id
       225 if type_id not in _ITEMS_ITER_LOOKUP:
   --> 226     raise KeyError(
       227         f"Can't resolve iterator for type '{self._schema_view.type}'"
       228     )
       230 factory = getattr(self, _ITEMS_ITER_LOOKUP[type_id])
       231 return factory(offset, length)
   
   KeyError: "Can't resolve iterator for type 'na'"
   
   
   ```


-- 
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]

Reply via email to