dangotbanned commented on code in PR #47609:
URL: https://github.com/apache/arrow/pull/47609#discussion_r2432752279


##########
python/pyarrow/tests/test_table.py:
##########
@@ -933,7 +947,10 @@ def test_table_from_struct_array_chunked_array():
         [[{"ints": 1}, {"floats": 1.0}]],
         type=pa.struct([("ints", pa.int32()), ("floats", pa.float32())]),
     )
-    result = pa.Table.from_struct_array(chunked_struct_array)
+    assert isinstance(chunked_struct_array.type, pa.StructType)
+    # Cast to the proper type for type checker
+    struct_chunked_array = cast(pa.ChunkedArray[pa.StructScalar], 
chunked_struct_array)
+    result = pa.Table.from_struct_array(struct_chunked_array)

Review Comment:
   I wonder if it is worth linking the cause of this issue?
   
   - 
https://github.com/apache/arrow/discussions/45919#discussioncomment-14290568
   - 
https://github.com/apache/arrow/discussions/45919#discussioncomment-14294980
   
   *I think* it is due to incomplete overloads for all of:
   
   - 
[`ChunkedArray.type`](https://github.com/rok/arrow/blob/5ab15e7618120a33ca6af440ca68093f102aef54/python/pyarrow-stubs/pyarrow/table.pyi#L136-L137)
   - 
[`chunked_array`](https://github.com/rok/arrow/blob/5ab15e7618120a33ca6af440ca68093f102aef54/python/pyarrow-stubs/pyarrow/table.pyi#L264-L281)
   - 
[`Table.from_struct_array`](https://github.com/rok/arrow/blob/5ab15e7618120a33ca6af440ca68093f102aef54/python/pyarrow-stubs/pyarrow/table.pyi#L561-L564)
   
   



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