Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-8209

[Python] Accessing duplicate column of Table by name gives wrong error

    XMLWordPrintableJSON

Details

    Description

      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:

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

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

      Attachments

        Issue Links

          Activity

            People

              wesm Wes McKinney
              jorisvandenbossche Joris Van den Bossche
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h