Skip to content

Commit

Permalink
perf: avoid unnecessary reset_index in join (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli authored Jul 10, 2024
1 parent f7c3890 commit 9042400
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions narwhals/_pandas_like/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ def join(
)
.loc[lambda t: t[indicator_token] == "left_only"]
.drop(columns=[indicator_token])
.reset_index(drop=True)
)

if how == "semi":
Expand All @@ -382,7 +381,7 @@ def join(
how="inner",
left_on=left_on,
right_on=left_on,
).reset_index(drop=True)
)
)

return self._from_native_dataframe(
Expand Down

0 comments on commit 9042400

Please sign in to comment.