-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
TYP: Subset of "Improved the type stubs in the _libs directory to help with type checking" #44251
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 all commits
181dc24
87873e4
da300c9
47e6cfb
aa96f6c
e9e9878
1002d00
b59ecd8
f7ca693
d5f807d
8830a41
fac9933
c3b0d28
113ee89
23ce14a
aa08042
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import numpy as np | ||
from numpy import typing as npt | ||
|
||
class NAType: ... | ||
|
||
NA: NAType | ||
|
||
def is_matching_na( | ||
left: object, right: object, nan_matches_none: bool = ... | ||
) -> bool: ... | ||
def isposinf_scalar(val: object) -> bool: ... | ||
def isneginf_scalar(val: object) -> bool: ... | ||
def checknull(val: object, inf_as_na: bool = ...) -> bool: ... | ||
def isnaobj(arr: np.ndarray, inf_as_na: bool = ...) -> npt.NDArray[np.bool_]: ... | ||
def is_numeric_na(values: np.ndarray) -> npt.NDArray[np.bool_]: ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
class OutOfBoundsDatetime(ValueError): ... | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -912,6 +912,10 @@ def maybe_upcast( | |
# We get a copy in all cases _except_ (values.dtype == new_dtype and not copy) | ||
upcast_values = values.astype(new_dtype, copy=copy) | ||
|
||
# error: Incompatible return value type (got "Tuple[ndarray[Any, dtype[Any]], | ||
# Union[Union[str, int, float, bool] Union[Period, Timestamp, Timedelta, Any]]]", | ||
# expected "Tuple[NumpyArrayT, Union[Union[str, int, float, bool], Union[Period, | ||
# Timestamp, Timedelta, Any]]]") | ||
return upcast_values, fill_value # type: ignore[return-value] | ||
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 probably be 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. The dtype can change but the Python type (i.e. np.ndarray or subclass) maybe preserved. I'm not sure but the numpy types don't annotate as preserving Python object type so maybe not. This was added for |
||
|
||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.