Skip to content

CLN: remove unused kwarg from IntervalIndex._searchsorted_monotonic #40578

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 1 commit into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5678,7 +5678,7 @@ def _maybe_cast_slice_bound(self, label, side: str_t, kind):

return label

def _searchsorted_monotonic(self, label, side="left"):
def _searchsorted_monotonic(self, label, side: str_t = "left"):
if self.is_monotonic_increasing:
return self.searchsorted(label, side=side)
elif self.is_monotonic_decreasing:
Expand Down
6 changes: 3 additions & 3 deletions pandas/core/indexes/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ def _maybe_convert_i8(self, key):

return key_i8

def _searchsorted_monotonic(self, label, side, exclude_label=False):
def _searchsorted_monotonic(self, label, side: str = "left"):
if not self.is_non_overlapping_monotonic:
raise KeyError(
"can only get slices from an IntervalIndex if bounds are "
Expand All @@ -615,11 +615,11 @@ def _searchsorted_monotonic(self, label, side, exclude_label=False):
side == "right" and not self.left.is_monotonic_increasing
):
sub_idx = self.right
if self.open_right or exclude_label:
if self.open_right:
label = _get_next_label(label)
else:
sub_idx = self.left
if self.open_left or exclude_label:
if self.open_left:
label = _get_prev_label(label)

return sub_idx._searchsorted_monotonic(label, side)
Expand Down