-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Array.__setitem__ failing with nullable boolean mask #31484
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
Changes from all commits
7e461a1
1314059
8bcb313
24c3ede
dea38f2
cd9e7ac
e5e912b
f8661e3
355dce9
e1c53f0
bc2add3
82cbaed
5950455
e3bf159
f7c6357
64f2359
a4451ba
6554b49
9ad0cbe
edd4514
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
import pytest | ||
|
||
import pandas as pd | ||
from pandas.core.arrays.numpy_ import PandasDtype | ||
|
||
from .base import BaseExtensionTests | ||
|
||
|
@@ -195,3 +196,14 @@ def test_setitem_preserves_views(self, data): | |
data[0] = data[1] | ||
assert view1[0] == data[1] | ||
assert view2[0] == data[1] | ||
|
||
def test_setitem_nullable_mask(self, data): | ||
# GH 31446 | ||
# TODO: there is some issue with PandasArray, therefore, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you create an issue for this? (e.g. PandasArray support for setitem) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will do There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @charlesdong1991 is there an opened issue for this yet? I haven't found it and it causes CI of geopandas to fail as contrary to the comment this test is not skipped. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @martinfleis The issue for geopandas is not due to PandasArray not working, but rather because we need to update our |
||
# TODO: skip the setitem test for now, and fix it later | ||
if data.dtype != PandasDtype("object"): | ||
arr = data[:5] | ||
expected = data.take([0, 0, 0, 3, 4]) | ||
mask = pd.array([True, True, True, False, False]) | ||
arr[mask] = data[0] | ||
self.assert_extension_array_equal(expected, arr) |
Uh oh!
There was an error while loading. Please reload this page.