-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CI: Test numpy 1.24 on 3.11 build #51006
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 15 commits
b58c1da
993dec4
27ceb6e
05f9c44
b014724
860cc0c
98d7ff9
d32a255
4cc5f43
0e00936
b8e24b6
b757913
4550442
9558d56
52efeec
8bbb6fc
bc256fc
3e3aaf0
b3b107f
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 |
---|---|---|
|
@@ -428,10 +428,14 @@ def to_numpy( | |
"for this dtype." | ||
) | ||
# don't pass copy to astype -> always need a copy since we are mutating | ||
data = self._data.astype(dtype) | ||
with warnings.catch_warnings(): | ||
warnings.filterwarnings("ignore") | ||
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. It would be good to now what type of warnings these 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. All runtime warnings iirc, but can add |
||
data = self._data.astype(dtype) | ||
data[self._mask] = na_value | ||
else: | ||
data = self._data.astype(dtype, copy=copy) | ||
with warnings.catch_warnings(): | ||
warnings.filterwarnings("ignore") | ||
data = self._data.astype(dtype, copy=copy) | ||
return data | ||
|
||
@doc(ExtensionArray.tolist) | ||
|
@@ -464,7 +468,10 @@ def astype(self, dtype: AstypeArg, copy: bool = True) -> ArrayLike: | |
# if we are astyping to another nullable masked dtype, we can fastpath | ||
if isinstance(dtype, BaseMaskedDtype): | ||
# TODO deal with NaNs for FloatingArray case | ||
data = self._data.astype(dtype.numpy_dtype, copy=copy) | ||
with warnings.catch_warnings(): | ||
warnings.filterwarnings("ignore") | ||
# TODO: Is rounding what we want long term? | ||
data = self._data.astype(dtype.numpy_dtype, copy=copy) | ||
# mask is copied depending on whether the data was copied, and | ||
# not directly depending on the `copy` keyword | ||
mask = self._mask if data is self._data else self._mask.copy() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -804,7 +804,7 @@ def test_constructor_floating_data_int_dtype(self, frame_or_series): | |
# Long-standing behavior (for Series, new in 2.0 for DataFrame) | ||
# has been to ignore the dtype on these; | ||
# not clear if this is what we want long-term | ||
expected = frame_or_series(arr) | ||
# expected = frame_or_series(arr) | ||
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. Are these supposed to be commented out? 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. Yes, they were unused, but the comment above is a bit confusing, that’s why I did not delete them |
||
|
||
# GH#49599 as of 2.0 we raise instead of silently retaining float dtype | ||
msg = "Trying to coerce float values to integer" | ||
|
@@ -816,7 +816,7 @@ def test_constructor_floating_data_int_dtype(self, frame_or_series): | |
|
||
# pre-2.0, when we had NaNs, we silently ignored the integer dtype | ||
arr[0] = np.nan | ||
expected = frame_or_series(arr) | ||
# expected = frame_or_series(arr) | ||
|
||
msg = r"Cannot convert non-finite values \(NA or inf\) to integer" | ||
with pytest.raises(IntCastingNaNError, match=msg): | ||
|
Uh oh!
There was an error while loading. Please reload this page.