You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Wes McKinney (Jira)" <ji...@apache.org> on 2020/04/04 22:56:00 UTC

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

     [ https://issues.apache.org/jira/browse/ARROW-8209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wes McKinney resolved ARROW-8209.
---------------------------------
    Resolution: Fixed

Issue resolved by pull request 6831
[https://github.com/apache/arrow/pull/6831]

> [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
>            Assignee: Wes McKinney
>            Priority: Minor
>              Labels: beginner, pull-request-available
>             Fix For: 0.17.0
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> 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)