You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@arrow.apache.org by "Joris Van den Bossche (Jira)" <ji...@apache.org> on 2020/03/25 14:59:00 UTC

[jira] [Created] (ARROW-8209) [Python] Accessing duplicate column of Table by name gives wrong error

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)