Skip to content

Commit

Permalink
precompute set
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisvandenbossche committed Jan 24, 2018
1 parent b7e0560 commit 54c5bf5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/pyarrow/pandas_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,11 @@ def dataframe_to_arrays(df, schema, preserve_index, nthreads=1):
convert_types.append(type)
column_names.append(name)

column_names_set = set(column_names)
for i, column in enumerate(index_columns):
columns_to_convert.append(column)
convert_types.append(None)
name = _index_level_name(column, i, column_names)
name = _index_level_name(column, i, column_names_set)
index_column_names.append(name)

# NOTE(wesm): If nthreads=None, then we use a heuristic to decide whether
Expand Down

0 comments on commit 54c5bf5

Please sign in to comment.