Athanassios Hatzis created ARROW-9376:

             Summary: [Python]
                 Key: ARROW-9376
             Project: Apache Arrow
          Issue Type: Bug
          Components: Python
    Affects Versions: 0.17.1
            Reporter: Athanassios Hatzis

h3. First try
 data = [pa.array([1, 2, 3, 4]), pa.array(['foo', 'bar', 'baz', None]), 
pa.array([True, None, False, True])]
 batch = pa.RecordBatch.from_arrays(data, ['f0', 'f1', 'f2'])
Hi, I use PyCharm IDE for development and I am getting the following inspection 
description when I write this piece of code above in the editor.

_Expected type 'RecordBatch', got 'List[Union[Union[ChunkedArray, Array], 
Any]]' instead_

_Inspection info: This inspection detects type errors in function call 
expressions. Due to dynamic dispatch and duck typing, this is possible in a 
limited but useful number of cases. Types of function parameters can be 
specified in docstrings or in Python 3 function annotations._
h3. Second try
batch = pa.RecordBatch.from_arrays(data, names=['f0', 'f1', 'f2']){code}
Then you get an insection descriptions

_Parameter 'list_arrays' unfilled_

_Passing list instead of pyarrow.lib.RecordBatch.RecordBatch. Is this 
h3. Third try
batch = pa.RecordBatch.from_arrays(list_arrays=data, names=['f0', 'f1', 'f2'])
Then you get an insection description and a type error

 _Parameter 'self' unfilled_ 
 _TypeError: from_arrays() takes at least 1 positional argument (0 given)_ 


Similar response, behaviour happens with the pa.Table.from_arrays


This message was sent by Atlassian Jira

Reply via email to