You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "jorisvandenbossche (via GitHub)" <gi...@apache.org> on 2023/03/23 17:15:10 UTC

[GitHub] [arrow] jorisvandenbossche commented on issue #25672: [Python] Struct types are unhandled in AppendNdarrayItem when converting from a Python sequence to Arrow array in python_to_arrow.cc

jorisvandenbossche commented on issue #25672:
URL: https://github.com/apache/arrow/issues/25672#issuecomment-1481577090

   We don't have an exact reproducer, but so this is something that failed in the past with a similar error (the list item is a numpy array instead of a list):
   
   ```
   In [1]: pa.array([np.array([{'a': 1, 'b': 2}, {'a': 3, 'b': 4}], dtype=object)])
   ...
   ArrowTypeError: Unknown list item type: struct<a: int64, b: int64>
   ```
   
   And that now works:
   
   ```
   In [1]: pa.array([np.array([{'a': 1, 'b': 2}, {'a': 3, 'b': 4}], dtype=object)])
   Out[1]: 
   <pyarrow.lib.ListArray object at 0x7fa6eccc3700>
   [
     -- is_valid: all not null
     -- child 0 type: int64
       [
         1,
         3
       ]
     -- child 1 type: int64
       [
         2,
         4
       ]
   ]
   In [2]: _.type
   Out[2]: ListType(list<item: struct<a: int64, b: int64>>)
   ```
   
   So closing this.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org