-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
TYP: update for numpy-1.21.0 #42200
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
TYP: update for numpy-1.21.0 #42200
Changes from 1 commit
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 |
---|---|---|
|
@@ -6,7 +6,6 @@ | |
|
||
from collections import abc | ||
from typing import ( | ||
TYPE_CHECKING, | ||
Any, | ||
Hashable, | ||
Sequence, | ||
|
@@ -86,10 +85,6 @@ | |
create_block_manager_from_blocks, | ||
) | ||
|
||
if TYPE_CHECKING: | ||
from numpy.ma.mrecords import MaskedRecords | ||
|
||
|
||
# --------------------------------------------------------------------- | ||
# BlockManager Interface | ||
|
||
|
@@ -142,7 +137,7 @@ def arrays_to_mgr( | |
|
||
|
||
def rec_array_to_mgr( | ||
data: MaskedRecords | np.recarray | np.ndarray, | ||
data: np.ma.MaskedArray | np.recarray | np.ndarray, | ||
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. why this change? 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. There's a
in the body that implies that MaskedArray (which is a superclass?) is allowed? 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. In all tests that get here, we have 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.
Since
Isn't the point of mypy to catch the cases where we don't have tests? but ok to leave for now. as we now have a cast and comment to highlight the issue |
||
index, | ||
columns, | ||
dtype: DtypeObj | None, | ||
|
@@ -188,7 +183,7 @@ def rec_array_to_mgr( | |
return mgr | ||
|
||
|
||
def fill_masked_arrays(data: MaskedRecords, arr_columns: Index) -> list[np.ndarray]: | ||
def fill_masked_arrays(data: np.ma.MaskedArray, arr_columns: Index) -> list[np.ndarray]: | ||
""" | ||
Convert numpy MaskedRecords to ensure mask is softened. | ||
""" | ||
|
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.
why can't we just use np.ndarray?