Joris Van den Bossche created ARROW-8209:
--------------------------------------------

             Summary: [Python] Accessing duplicate column of Table by name 
gives wrong error
                 Key: ARROW-8209
                 URL: https://issues.apache.org/jira/browse/ARROW-8209
             Project: Apache Arrow
          Issue Type: Bug
          Components: Python
            Reporter: Joris Van den Bossche


When you have a table with duplicate column names and you try to access this 
column, you get an error about the column not existing:

{code}
>>> table = pa.table([pa.array([1, 2, 3]), pa.array([4, 5, 6]), pa.array([7, 8, 
>>> 9])], names=['a', 'b', 'a']) 

>>> table.column('a')                                                           
>>>                                                                             
>>>                                                    
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-6-14fad86d3142> in <module>
----> 1 table.column('a')

~/scipy/repos/arrow/python/pyarrow/table.pxi in pyarrow.lib.Table.column()

KeyError: 'Column a does not exist in table'
{code}

It should rather give an error message about the column name being duplicate.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to