Skip to content
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

Support at/iat indexers in cudf.pandas #16177

Merged
merged 8 commits into from
Jul 8, 2024

Conversation

mroeschke
Copy link
Contributor

Description

closes #16112

Checklist

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

@mroeschke mroeschke added bug Something isn't working non-breaking Non-breaking change cudf.pandas Issues specific to cudf.pandas labels Jul 2, 2024
@mroeschke mroeschke requested a review from a team as a code owner July 2, 2024 17:04
@mroeschke mroeschke requested review from isVoid and Matt711 July 2, 2024 17:04
@github-actions github-actions bot added the Python Affects Python cuDF API. label Jul 2, 2024


@pytest.mark.parametrize("indexer", ["at", "iat"])
def test_at_iat(indexer):
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this cover the case of a new column that doesn't exist? I'd like to see a test that more clearly resembles the patterns in the minimal repro of #16112.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, added a unit test in a43454c to mirror the issue. (It appears that iat.__setitem__ in pandas doesn't support the type of behavior demonstrated in the issue)

Copy link
Contributor Author

@mroeschke mroeschke Jul 3, 2024

Choose a reason for hiding this comment

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

Huh, thanks for encouraging a unit test with the issue. Even though the test passed locally the CI didn't agree.

Left some investigation notes in #16112 (comment) that I may come back to later

@mroeschke mroeschke marked this pull request as draft July 3, 2024 20:25
@mroeschke mroeschke marked this pull request as ready for review July 5, 2024 19:41
@bdice
Copy link
Contributor

bdice commented Jul 5, 2024

@mroeschke There's one failing test:

=========================== short test summary info ============================
FAILED python/cudf/cudf_pandas_tests/test_cudf_pandas.py::test_at_setitem_empty - AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="name") are different

Attribute "dtype" are different
[left]:  object
[right]: float64
FAILED python/cudf/cudf_pandas_tests/test_profiler.py::test_profiler_fast_slow_name_mismatch - AttributeError: '_iLocIndexer' object has no attribute '_convert_key'

Once that's fixed up I can approve.

@mroeschke
Copy link
Contributor Author

Thanks @bdice all green here

@mroeschke
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit e9cb7dd into rapidsai:branch-24.08 Jul 8, 2024
81 checks passed
@mroeschke mroeschke deleted the bug/cdfp/at branch July 26, 2024 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cudf.pandas Issues specific to cudf.pandas non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[BUG] .at accessor for new column fails in cudf.pandas
2 participants