Skip to content

Commit

Permalink
Fixing bug in insert (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
devin-petersohn authored and kunalgosar committed Jun 25, 2018
1 parent f049ece commit 52594ad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modin/dataframe/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -2335,6 +2335,8 @@ def insert(self, loc, column, value, allow_duplicates=False):
partition, index_within_partition = \
self._col_metadata.insert(column, loc)

index = self.index

# Deploy insert function to specific column partition, and replace that
# column
def insert_col_part(df):
Expand All @@ -2348,8 +2350,10 @@ def insert_col_part(df):
value, allow_duplicates)
df.index = pandas.RangeIndex(0, len(df))
else:
df.index = index
df.insert(index_within_partition, column,
value, allow_duplicates)
df.index = pandas.RangeIndex(0, len(df))
return df

new_obj = _deploy_func.remote(insert_col_part,
Expand Down

0 comments on commit 52594ad

Please sign in to comment.