Skip to content

Conversation

@Matt711
Copy link
Contributor

@Matt711 Matt711 commented Jan 28, 2026

Description

Closes #20561

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Resolves rapidsai#20561

In pandas, .at and .iat are scalar-only indexers that reject
list-like inputs, unlike .loc and .iloc which accept broader
indexing. cuDF was incorrectly allowing list-like indexers for
at/iat.

Changes:
- Add validate_scalar_key() function in indexing_utils.py that
  validates keys contain only scalar values
- Update _SeriesAtIndexer and _SeriesiAtIndexer to validate keys
- Update _DataFrameAtIndexer and _DataFrameiAtIndexer to validate keys
- Add comprehensive test coverage for at/iat validation

Error messages match pandas where possible:
- .at raises ValueError with "Invalid call for scalar access"
- .iat raises ValueError with "iAt based indexing can only have integer indexers"

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@Matt711 Matt711 requested a review from a team as a code owner January 28, 2026 05:52
@Matt711 Matt711 added the bug Something isn't working label Jan 28, 2026
@Matt711 Matt711 added the non-breaking Non-breaking change label Jan 28, 2026
@github-actions github-actions bot added the Python Affects Python cuDF API. label Jan 28, 2026
@GPUtester GPUtester moved this to In Progress in cuDF Python Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working non-breaking Non-breaking change Python Affects Python cuDF API.

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

[BUG] Reconcile differences between at/iat and loc/iloc, respectively

2 participants