Skip to content

Patch - updates maybe_indices_to_slice to use intp_t #59537

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

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 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/_libs/lib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def maybe_booleans_to_slice(
) -> slice | npt.NDArray[np.uint8]: ...
def maybe_indices_to_slice(
indices: npt.NDArray[np.intp],
max_len: int,
max_len: np.unit64,
) -> slice | npt.NDArray[np.intp]: ...
def is_all_arraylike(obj: list) -> bool: ...

Expand Down
4 changes: 2 additions & 2 deletions pandas/_libs/lib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -494,10 +494,10 @@ def has_only_ints_or_nan(const floating[:] arr) -> bool:
return True


def maybe_indices_to_slice(ndarray[intp_t, ndim=1] indices, int max_len):
def maybe_indices_to_slice(ndarray[intp_t, ndim=1] indices, uint64_t max_len):
cdef:
Py_ssize_t i, n = len(indices)
intp_t k, vstart, vlast, v
uint64_t k, vstart, vlast, v

if n == 0:
return slice(0, 0)
Expand Down
Loading