apache / apache/arrow

[Python][CSV] Сannot remove columns with the same name from a table

Open
#45,590 4 comments 0 reactions 0 assignees View on GitHub
Component: Python Type: bug
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

### Describe the bug, including details regarding any error messages, version, and platform.

```
table = pyarrow.csv.read_csv(file)
table.drop_columns(table.column_names[3:])
```
I get an error:
```
KeyError: "Column 'san+francisco,ca_uvIndex' not found"
```
Actually, the table has such a column, even two (I don’t know why they have the same names, such a dataset). This works if you change one of the column names in the csv file.

### Component(s)

Python

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.