Skip to content

TYP: pd.isna #46222

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

Merged
merged 22 commits into from
Mar 18, 2022
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
632eed5
TYP: pd.isna
twoertwein Mar 4, 2022
4496f42
address review
twoertwein Mar 4, 2022
b77f716
avoid needing to import npt at runtime
twoertwein Mar 4, 2022
24aec6f
comment for cast
twoertwein Mar 5, 2022
c1204b4
remove to
twoertwein Mar 5, 2022
a0d8123
Merge remote-tracking branch 'upstream/main' into isna
twoertwein Mar 5, 2022
b412060
back to Index
twoertwein Mar 6, 2022
17c9779
remove unused Scalar
twoertwein Mar 6, 2022
a4d0dfa
Merge remote-tracking branch 'upstream/main' into isna
twoertwein Mar 6, 2022
2d7f86a
get left | right on the same line to avoid mypy printing a 'note'
twoertwein Mar 6, 2022
eb16bc3
ArrayLike
twoertwein Mar 7, 2022
b9288cb
unsupported overloads
twoertwein Mar 7, 2022
c77248f
all typing imports witihn TYPE_CHECKING
twoertwein Mar 7, 2022
70d5d60
Revert "unsupported overloads"
twoertwein Mar 8, 2022
1d2afd5
Merge remote-tracking branch 'upstream/main' into isna
twoertwein Mar 8, 2022
5f8b856
handle unions
twoertwein Mar 8, 2022
7e65d89
do not require Series to be imported at runtime
twoertwein Mar 8, 2022
a0cf860
CI/TST: numpy 1.22.3 release fixes (#46274)
mroeschke Mar 9, 2022
a29a9e0
TYP: annotation of __init__ return type (PEP 484) (misc modules) (#46…
EkaterinaKuzkina Mar 9, 2022
d1957f4
TYP: annotation of __init__ return type (PEP 484) (pandas/tests) (#46…
EkaterinaKuzkina Mar 9, 2022
c319692
TYP: add type annotation to DataFrame.to_pickle (#46262)
Moisan Mar 9, 2022
f1d0309
Merge remote-tracking branch 'upstream/main' into isna
twoertwein Mar 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pandas/core/arrays/boolean.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ def coerce_to_array(
if inferred_dtype not in ("boolean", "empty") + integer_like:
raise TypeError("Need to pass bool-like values")

# mypy does not to narrow the type of mask_values to npt.NDArray[np.bool_]
# within this branch, it assumes it can also be None
mask_values = cast("npt.NDArray[np.bool_]", isna(values_object))
values = np.zeros(len(values), dtype=bool)
values[~mask_values] = values_object[~mask_values].astype(bool)
Expand Down