MainRo opened a new issue, #45527:
URL: https://github.com/apache/arrow/issues/45527

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   Doing introspection on a Schema object fails on ListType fields.
   On this example schema:
   
   ```python
   test_schema = pa.schema([
       ('f0', pa.string()),
       ('f1', pa.list_(pa.string())),
   ])
   ```
   
   The string representation is:
   ```
   print(test_schema)
   f0: string
   f1: list<item: string>
     child 0, item: string
   ```
   
   When doing introspection with the flatten method, it fails to go through the 
"item" layer of the list, and instead iterates infinitely on it:
   
   ```python
   print(test_schema.field(1).name)
   print(test_schema.field(1).flatten())
   print(test_schema.field(1).flatten()[0].flatten())
   ...
   ```
   
   ```
   f1
   [pyarrow.Field<f1: list<item: string>>]
   [pyarrow.Field<f1: list<item: string>>]
   ...
   ```
   
   I would expect the following result:
   ```
   f1
   [pyarrow.Field<f1: list<item: string>>]
   [pyarrow.Field<f1.item: string>]
   ```
   
   That would allow to iterate through the whole schema fields.
   
   ### 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: issues-unsubscr...@arrow.apache.org.apache.org

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

Reply via email to