Skip to content

.format changed to f string #33602

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions pandas/core/reshape/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -1727,20 +1727,19 @@ def flip(xs) -> np.ndarray:
tolerance = self.tolerance

# we require sortedness and non-null values in the join keys
msg_sorted = "{side} keys must be sorted"
msg_missings = "Merge keys contain null values on {side} side"

if not Index(left_values).is_monotonic:
side = "left"
if isna(left_values).any():
raise ValueError(msg_missings.format(side="left"))
raise ValueError(f"Merge keys contain null values on {side} side")
else:
raise ValueError(msg_sorted.format(side="left"))
raise ValueError(f"{side} keys must be sorted")

if not Index(right_values).is_monotonic:
side = "right"
if isna(right_values).any():
raise ValueError(msg_missings.format(side="right"))
raise ValueError(f"Merge keys contain null values on {side} side")
else:
raise ValueError(msg_sorted.format(side="right"))
raise ValueError(f"{side} keys must be sorted")

# initial type conversion as needed
if needs_i8_conversion(left_values):
Expand Down