-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Series construction with EA dtype and index but no data fails #33846
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 8 commits
a06e1a4
6ae3342
72f8ec3
7a17b33
1881a03
45ef9a5
a339f05
6bfbd1a
1c8bd8c
840df49
9cf81ee
d427714
d47cba4
c5cc30d
421aa7c
4c51356
ff4ff63
aa11bb6
268f3a5
2df2bf1
211328c
e598f4c
8c44e23
dac66d0
b363fb2
f2026d3
52fcd7f
4907f34
663c863
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 |
---|---|---|
|
@@ -150,6 +150,21 @@ def test_from_dtype(self, data): | |
# construct from our dtype & string dtype | ||
pass | ||
|
||
@pytest.mark.xfail(reason="GH-26469") | ||
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. should these be a new issue? 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. a few checks to go but I think we need a discussion on when to allow a collection to be treated as scalar. so yes, will probably raise an issue for this. 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. kk, and just flip the references to that, otherwise lgtm. ping on green. 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. |
||
def test_series_constructor_no_data_with_index(self, dtype, na_value): | ||
# RecursionError: maximum recursion depth exceeded in comparison | ||
super().test_series_constructor_no_data_with_index(dtype, na_value) | ||
|
||
@pytest.mark.xfail(reason="GH-26469") | ||
def test_series_constructor_scalar_na_with_index(self, dtype, na_value): | ||
# RecursionError: maximum recursion depth exceeded in comparison | ||
super().test_series_constructor_scalar_na_with_index(dtype, na_value) | ||
|
||
@pytest.mark.xfail(reason="GH-26469") | ||
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 add a more informative message |
||
def test_series_constructor_scalar_with_index(self, data, dtype): | ||
# TypeError: All values must be of type <class 'collections.abc.Mapping'> | ||
super().test_series_constructor_scalar_with_index(data, dtype) | ||
|
||
|
||
class TestReshaping(BaseJSON, base.BaseReshapingTests): | ||
@pytest.mark.skip(reason="Different definitions of NA") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,6 +151,11 @@ def test_array_from_scalars(self, data): | |
# ValueError: PandasArray must be 1-dimensional. | ||
super().test_array_from_scalars(data) | ||
|
||
@skip_nested | ||
def test_series_constructor_scalar_with_index(self, data, dtype): | ||
# ValueError: Length of passed values is 1, index implies 3. | ||
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. for the object dtype, the scalar is a tuple, so this failure is related to #33846 (comment) |
||
super().test_series_constructor_scalar_with_index(data, dtype) | ||
|
||
|
||
class TestDtype(BaseNumPyTests, base.BaseDtypeTests): | ||
@pytest.mark.skip(reason="Incorrect expected.") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could look into how to identify a collection that could be considered a 'scalar' for some EA, eg JSONDtype. although I think out-of-scope for the issue that this PR attempts to fix (i.e. IntegerArray, where the scalars are scalars)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather than this I would call:
construct_1d_arraylike_from_scalar
but I wouldn't do this right here, rather on L453, e.g. add an elif is_scalar(data)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's option 3 in #33846 (comment)
do this just for EA types and keep the code path the same for non-EA types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no this will work generically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm getting a few failures in pandas/tests/series/test_constructors.py. i'll push the change anyway use the ci to see what else fails while I investigate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kk