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

TST: Fix setitem parametrizations #56890

Closed
wants to merge 11 commits into from

Conversation

lopof
Copy link
Contributor

@lopof lopof commented Jan 15, 2024

I'm not sure if i am on the right track with this PR but it's a try. If not i will close it and probably someone more into the code has to dig into that issue.

@mroeschke mroeschke added Testing pandas testing functions or related to the test suite ExtensionArray Extending pandas with custom dtypes or arrays. labels Jan 23, 2024
@@ -2051,6 +2054,8 @@ def setitem(self, indexer, value, using_cow: bool = False):
# TODO(GH#45419): string[pyarrow] tests break if we transpose
# unconditionally
values = values.T

check_array_indexer(values, indexer)
Copy link
Member

Choose a reason for hiding this comment

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

@jbrockmendel
Copy link
Member

I'd like to understand how this relates to #31948 (for which the behavior seems to have changed since it was opened).

Ideally we'd do checks on the indexer once at the DataFrame/Series level instead of at the block level which can end up doing them repeatedly.

@lopof
Copy link
Contributor Author

lopof commented Feb 5, 2024

@jbrockmendel i updated #31948 with the current behavior. What would be the desired behavior? Maybe the test has wrong expectations...

@lopof
Copy link
Contributor Author

lopof commented Feb 5, 2024

With @pytest.mark.filterwarnings("ignore::FutureWarning"), as the only change, instead of

if type(arr) is pd.Series:
    arr.iloc[idx] = arr.iloc[0]
else:
    arr[idx] = arr[0]

the main reason the test are failing is KeyError: '[0 1 2 <NA>] not in index' is raised.
But this could also be the desired Error?

@lopof
Copy link
Contributor Author

lopof commented Feb 26, 2024

i opened a new PR, that only changes the setitem-py, but does does pass all tests. See #57629

@lopof
Copy link
Contributor Author

lopof commented Mar 4, 2024

@jbrockmendel @mroeschke maybe you can have a look at #57629

Copy link
Contributor

github-actions bot commented Apr 4, 2024

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Apr 4, 2024
@mroeschke
Copy link
Member

Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.

@mroeschke mroeschke closed this Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ExtensionArray Extending pandas with custom dtypes or arrays. Stale Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TST: test_setitem_integer_with_missing_raises contains duplicate parametrization
3 participants