Skip to content

Conversation

@natmokval
Copy link
Contributor

@natmokval natmokval commented Dec 17, 2025

@natmokval natmokval added Indexing Related to indexing on series/frames, not to indexes themselves Enhancement labels Dec 17, 2025
@natmokval natmokval marked this pull request as draft December 17, 2025 12:50
@natmokval natmokval marked this pull request as ready for review December 17, 2025 14:28
@mroeschke mroeschke requested a review from rhshadrach December 17, 2025 17:22
@mroeschke mroeschke added the Error Reporting Incorrect or improved errors from pandas label Dec 17, 2025
Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

Comment on lines +6873 to +6874
f"with a non-specific label: {original_label!r}. "
"Please specify the label."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
f"with a non-specific label: {original_label!r}. "
"Please specify the label."
f"with a missing label {original_label!r}. "
"Either sort the index or specify an existing label."

It's not clear to me what "non-specific" here means.

f"Cannot get {side} slice bound for non-monotonic index "
f"with a non-specific label: {original_label!r}. "
"Please specify the label."
) from err
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should remain

Suggested change
) from err
) from None

We know that it's due to a missing label, adding the previous stack trace does not help clarify the error for the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Error Reporting Incorrect or improved errors from pandas Indexing Related to indexing on series/frames, not to indexes themselves

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Series.loc slicing raises KeyError unexpectedly

3 participants