-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
BUG: Set check_exact to true if dtype is int #55934
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
4eabcd6
bce3087
8fd5e61
c3ecb84
6d74ec3
8f608a0
c46b2d6
a4eabea
00b7c91
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 |
---|---|---|
|
@@ -572,7 +572,10 @@ def test_constructor_maskedarray(self): | |
data[1] = 1 | ||
result = Series(data, index=index) | ||
expected = Series([0, 1, 2], index=index, dtype=int) | ||
tm.assert_series_equal(result, expected) | ||
with pytest.raises(AssertionError, match="Series classes are different"): | ||
# TODO should this be raising at all? | ||
# https://github.com/pandas-dev/pandas/issues/56131 | ||
tm.assert_series_equal(result, expected) | ||
Comment on lines
572
to
+578
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. This is a different issue than reported in #56131 (there is also no This doesn't involve different data types (it's all numpy dtypes), and the two objects created here seemingly are the same: data = np.ma.masked_all((3,), dtype=int)
data[0] = 0
data[1] = 1
data[2] = 2
index = ["a", "b", "c"]
result = Series(data, index=index)
expected = Series([0, 1, 2], index=index, dtype=int)
But apparently we have a bug in the Series constructor that preserves the masked array as underlying value if it has no masked elements:
That seems like a separate, actual bug we should solve, regardless of the behaviour of |
||
|
||
data = ma.masked_all((3,), dtype=bool) | ||
result = Series(data) | ||
|
@@ -589,7 +592,10 @@ def test_constructor_maskedarray(self): | |
data[1] = True | ||
result = Series(data, index=index) | ||
expected = Series([True, True, False], index=index, dtype=bool) | ||
tm.assert_series_equal(result, expected) | ||
with pytest.raises(AssertionError, match="Series classes are different"): | ||
# TODO should this be raising at all? | ||
# https://github.com/pandas-dev/pandas/issues/56131 | ||
tm.assert_series_equal(result, expected) | ||
|
||
data = ma.masked_all((3,), dtype="M8[ns]") | ||
result = Series(data) | ||
|
Uh oh!
There was an error while loading. Please reload this page.