Skip to content

Commit

Permalink
Deduplicate columns to select in add_keep_cols (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
praateekmahajan authored Sep 26, 2024
1 parent 2a0272a commit 7d4bccd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crossfit/op/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ def add_keep_cols(self, data, output):
output[col] = data[col]

columns = list(output.columns)
output = output[self.keep_cols + columns]
# we use dict.fromkeys to remove duplicates and preserve order
# (to match _build_dask_meta behavior)
output = output[list(dict.fromkeys(self.keep_cols + columns))]

return output

Expand Down

0 comments on commit 7d4bccd

Please sign in to comment.