Skip to content

CLN: enable reportInvalidStubStatement #43775

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 1 commit into from
Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
46 changes: 23 additions & 23 deletions pandas/_libs/algos.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ def kth_smallest(

def nancorr(
mat: np.ndarray, # const float64_t[:, :]
cov: bool = False,
minp=None,
cov: bool = ...,
minp=...,
) -> np.ndarray: ... # ndarray[float64_t, ndim=2]
def nancorr_spearman(
mat: np.ndarray, # ndarray[float64_t, ndim=2]
minp: int = 1,
minp: int = ...,
) -> np.ndarray: ... # ndarray[float64_t, ndim=2]
def nancorr_kendall(
mat: np.ndarray, # ndarray[float64_t, ndim=2]
minp: int = 1,
minp: int = ...,
) -> np.ndarray: ... # ndarray[float64_t, ndim=2]

# ----------------------------------------------------------------------
Expand All @@ -77,36 +77,36 @@ def nancorr_kendall(
# uint16_t
# uint8_t

def validate_limit(nobs: int | None, limit=None) -> int: ...
def validate_limit(nobs: int | None, limit=...) -> int: ...
def pad(
old: np.ndarray, # ndarray[algos_t]
new: np.ndarray, # ndarray[algos_t]
limit=None,
limit=...,
) -> np.ndarray: ... # np.ndarray[np.intp, ndim=1]
def pad_inplace(
values: np.ndarray, # algos_t[:]
mask: np.ndarray, # uint8_t[:]
limit=None,
limit=...,
) -> None: ...
def pad_2d_inplace(
values: np.ndarray, # algos_t[:, :]
mask: np.ndarray, # const uint8_t[:, :]
limit=None,
limit=...,
) -> None: ...
def backfill(
old: np.ndarray, # ndarray[algos_t]
new: np.ndarray, # ndarray[algos_t]
limit=None,
limit=...,
) -> np.ndarray: ... # np.ndarray[np.intp, ndim=1]
def backfill_inplace(
values: np.ndarray, # algos_t[:]
mask: np.ndarray, # uint8_t[:]
limit=None,
limit=...,
) -> None: ...
def backfill_2d_inplace(
values: np.ndarray, # algos_t[:, :]
mask: np.ndarray, # const uint8_t[:, :]
limit=None,
limit=...,
) -> None: ...
def is_monotonic(
arr: np.ndarray, # ndarray[algos_t, ndim=1]
Expand Down Expand Up @@ -150,18 +150,18 @@ def diff_2d(
) -> None: ...
def ensure_platform_int(arr: object) -> npt.NDArray[np.intp]: ...
def ensure_object(arr: object) -> npt.NDArray[np.object_]: ...
def ensure_complex64(arr: object, copy=True) -> npt.NDArray[np.complex64]: ...
def ensure_complex128(arr: object, copy=True) -> npt.NDArray[np.complex128]: ...
def ensure_float64(arr: object, copy=True) -> npt.NDArray[np.float64]: ...
def ensure_float32(arr: object, copy=True) -> npt.NDArray[np.float32]: ...
def ensure_int8(arr: object, copy=True) -> npt.NDArray[np.int8]: ...
def ensure_int16(arr: object, copy=True) -> npt.NDArray[np.int16]: ...
def ensure_int32(arr: object, copy=True) -> npt.NDArray[np.int32]: ...
def ensure_int64(arr: object, copy=True) -> npt.NDArray[np.int64]: ...
def ensure_uint8(arr: object, copy=True) -> npt.NDArray[np.uint8]: ...
def ensure_uint16(arr: object, copy=True) -> npt.NDArray[np.uint16]: ...
def ensure_uint32(arr: object, copy=True) -> npt.NDArray[np.uint32]: ...
def ensure_uint64(arr: object, copy=True) -> npt.NDArray[np.uint64]: ...
def ensure_complex64(arr: object, copy=...) -> npt.NDArray[np.complex64]: ...
def ensure_complex128(arr: object, copy=...) -> npt.NDArray[np.complex128]: ...
def ensure_float64(arr: object, copy=...) -> npt.NDArray[np.float64]: ...
def ensure_float32(arr: object, copy=...) -> npt.NDArray[np.float32]: ...
def ensure_int8(arr: object, copy=...) -> npt.NDArray[np.int8]: ...
def ensure_int16(arr: object, copy=...) -> npt.NDArray[np.int16]: ...
def ensure_int32(arr: object, copy=...) -> npt.NDArray[np.int32]: ...
def ensure_int64(arr: object, copy=...) -> npt.NDArray[np.int64]: ...
def ensure_uint8(arr: object, copy=...) -> npt.NDArray[np.uint8]: ...
def ensure_uint16(arr: object, copy=...) -> npt.NDArray[np.uint16]: ...
def ensure_uint32(arr: object, copy=...) -> npt.NDArray[np.uint32]: ...
def ensure_uint64(arr: object, copy=...) -> npt.NDArray[np.uint64]: ...
def take_1d_int8_int8(
values: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value=...
) -> None: ...
Expand Down
4 changes: 2 additions & 2 deletions pandas/_libs/arrays.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ class NDArrayBacked:
@property
def nbytes(self) -> int: ...
def copy(self): ...
def delete(self, loc, axis=0): ...
def delete(self, loc, axis=...): ...
def swapaxes(self, axis1, axis2): ...
def repeat(self, repeats: int | Sequence[int], axis: int | None = ...): ...
def reshape(self, *args, **kwargs): ...
def ravel(self, order="C"): ...
def ravel(self, order=...): ...
@property
def T(self): ...
2 changes: 1 addition & 1 deletion pandas/_libs/index.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class IndexEngine:
def __contains__(self, val: object) -> bool: ...
# -> int | slice | np.ndarray[bool]
def get_loc(self, val: object) -> int | slice | np.ndarray: ...
def sizeof(self, deep: bool = False) -> int: ...
def sizeof(self, deep: bool = ...) -> int: ...
def __sizeof__(self) -> int: ...
@property
def is_unique(self) -> bool: ...
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/internals.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class BlockManager:
_blknos: np.ndarray
_blklocs: np.ndarray
def __init__(
self, blocks: tuple[B, ...], axes: list[Index], verify_integrity=True
self, blocks: tuple[B, ...], axes: list[Index], verify_integrity=...
): ...
def get_slice(self: T, slobj: slice, axis: int = ...) -> T: ...
def _rebuild_blknos_and_blklocs(self) -> None: ...
26 changes: 13 additions & 13 deletions pandas/_libs/join.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def left_outer_join(
left: np.ndarray, # const intp_t[:]
right: np.ndarray, # const intp_t[:]
max_groups: int,
sort: bool = True,
sort: bool = ...,
) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...
def full_outer_join(
left: np.ndarray, # const intp_t[:]
Expand Down Expand Up @@ -54,40 +54,40 @@ def asof_join_backward_on_X_by_Y(
right_values: np.ndarray, # asof_t[:]
left_by_values: np.ndarray, # by_t[:]
right_by_values: np.ndarray, # by_t[:]
allow_exact_matches: bool = True,
tolerance=None,
allow_exact_matches: bool = ...,
tolerance=...,
) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...
def asof_join_forward_on_X_by_Y(
left_values: np.ndarray, # asof_t[:]
right_values: np.ndarray, # asof_t[:]
left_by_values: np.ndarray, # by_t[:]
right_by_values: np.ndarray, # by_t[:]
allow_exact_matches: bool = True,
tolerance=None,
allow_exact_matches: bool = ...,
tolerance=...,
) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...
def asof_join_nearest_on_X_by_Y(
left_values: np.ndarray, # asof_t[:]
right_values: np.ndarray, # asof_t[:]
left_by_values: np.ndarray, # by_t[:]
right_by_values: np.ndarray, # by_t[:]
allow_exact_matches: bool = True,
tolerance=None,
allow_exact_matches: bool = ...,
tolerance=...,
) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...
def asof_join_backward(
left_values: np.ndarray, # asof_t[:]
right_values: np.ndarray, # asof_t[:]
allow_exact_matches: bool = True,
tolerance=None,
allow_exact_matches: bool = ...,
tolerance=...,
) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...
def asof_join_forward(
left_values: np.ndarray, # asof_t[:]
right_values: np.ndarray, # asof_t[:]
allow_exact_matches: bool = True,
tolerance=None,
allow_exact_matches: bool = ...,
tolerance=...,
) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...
def asof_join_nearest(
left_values: np.ndarray, # asof_t[:]
right_values: np.ndarray, # asof_t[:]
allow_exact_matches: bool = True,
tolerance=None,
allow_exact_matches: bool = ...,
tolerance=...,
) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]: ...
52 changes: 26 additions & 26 deletions pandas/_libs/lib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ i8max: int
u8max: int

def item_from_zerodim(val: object) -> object: ...
def infer_dtype(value: object, skipna: bool = True) -> str: ...
def infer_dtype(value: object, skipna: bool = ...) -> str: ...
def is_iterator(obj: object) -> bool: ...
def is_scalar(val: object) -> bool: ...
def is_list_like(obj: object, allow_sets: bool = True) -> bool: ...
def is_list_like(obj: object, allow_sets: bool = ...) -> bool: ...
def is_period(val: object) -> bool: ...
def is_interval(val: object) -> bool: ...
def is_decimal(val: object) -> bool: ...
Expand All @@ -45,22 +45,22 @@ def is_interval_array(values: np.ndarray) -> bool: ...
def is_datetime64_array(values: np.ndarray) -> bool: ...
def is_timedelta_or_timedelta64_array(values: np.ndarray) -> bool: ...
def is_datetime_with_singletz_array(values: np.ndarray) -> bool: ...
def is_time_array(values: np.ndarray, skipna: bool = False): ...
def is_date_array(values: np.ndarray, skipna: bool = False): ...
def is_datetime_array(values: np.ndarray, skipna: bool = False): ...
def is_string_array(values: np.ndarray, skipna: bool = False): ...
def is_float_array(values: np.ndarray, skipna: bool = False): ...
def is_integer_array(values: np.ndarray, skipna: bool = False): ...
def is_bool_array(values: np.ndarray, skipna: bool = False): ...
def fast_multiget(mapping: dict, keys: np.ndarray, default=np.nan) -> np.ndarray: ...
def fast_unique_multiple_list_gen(gen: Generator, sort: bool = True) -> list: ...
def fast_unique_multiple_list(lists: list, sort: bool = True) -> list: ...
def fast_unique_multiple(arrays: list, sort: bool = True) -> list: ...
def is_time_array(values: np.ndarray, skipna: bool = ...): ...
def is_date_array(values: np.ndarray, skipna: bool = ...): ...
def is_datetime_array(values: np.ndarray, skipna: bool = ...): ...
def is_string_array(values: np.ndarray, skipna: bool = ...): ...
def is_float_array(values: np.ndarray, skipna: bool = ...): ...
def is_integer_array(values: np.ndarray, skipna: bool = ...): ...
def is_bool_array(values: np.ndarray, skipna: bool = ...): ...
def fast_multiget(mapping: dict, keys: np.ndarray, default=...) -> np.ndarray: ...
def fast_unique_multiple_list_gen(gen: Generator, sort: bool = ...) -> list: ...
def fast_unique_multiple_list(lists: list, sort: bool = ...) -> list: ...
def fast_unique_multiple(arrays: list, sort: bool = ...) -> list: ...
def map_infer(
arr: np.ndarray,
f: Callable[[Any], Any],
convert: bool = True,
ignore_na: bool = False,
convert: bool = ...,
ignore_na: bool = ...,
) -> np.ndarray: ...
@overload # both convert_datetime and convert_to_nullable_integer False -> np.ndarray
def maybe_convert_objects(
Expand Down Expand Up @@ -131,27 +131,27 @@ def maybe_convert_objects(
def maybe_convert_numeric(
values: npt.NDArray[np.object_],
na_values: set,
convert_empty: bool = True,
coerce_numeric: bool = False,
convert_empty: bool = ...,
coerce_numeric: bool = ...,
convert_to_masked_nullable: Literal[False] = ...,
) -> tuple[np.ndarray, None]: ...
@overload
def maybe_convert_numeric(
values: npt.NDArray[np.object_],
na_values: set,
convert_empty: bool = True,
coerce_numeric: bool = False,
convert_empty: bool = ...,
coerce_numeric: bool = ...,
*,
convert_to_masked_nullable: Literal[True],
) -> tuple[np.ndarray, np.ndarray]: ...

# TODO: restrict `arr`?
def ensure_string_array(
arr,
na_value: object = np.nan,
convert_na_value: bool = True,
copy: bool = True,
skipna: bool = True,
na_value: object = ...,
convert_na_value: bool = ...,
copy: bool = ...,
skipna: bool = ...,
) -> npt.NDArray[np.object_]: ...
def infer_datetimelike_array(
arr: npt.NDArray[np.object_],
Expand All @@ -169,7 +169,7 @@ def tuples_to_object_array(
) -> ndarray_obj_2d: ...

# TODO: can we be more specific about rows?
def to_object_array(rows: object, min_width: int = 0) -> ndarray_obj_2d: ...
def to_object_array(rows: object, min_width: int = ...) -> ndarray_obj_2d: ...
def dicts_to_array(dicts: list, columns: list) -> ndarray_obj_2d: ...
def maybe_booleans_to_slice(
mask: npt.NDArray[np.uint8],
Expand Down Expand Up @@ -214,8 +214,8 @@ def get_level_sorter(
def generate_bins_dt64(
values: npt.NDArray[np.int64],
binner: np.ndarray, # const int64_t[:]
closed: object = "left",
hasnans: bool = False,
closed: object = ...,
hasnans: bool = ...,
) -> np.ndarray: ... # np.ndarray[np.int64, ndim=1]
def array_equivalent_object(
left: np.ndarray, # object[:]
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/sparse.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class SparseIndex:
class IntIndex(SparseIndex):
indices: npt.NDArray[np.int32]
def __init__(
self, length: int, indices: Sequence[int], check_integrity: bool = True
self, length: int, indices: Sequence[int], check_integrity: bool = ...
): ...

class BlockIndex(SparseIndex):
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/fields.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def isleapyear_arr(
def build_isocalendar_sarray(
dtindex: npt.NDArray[np.int64], # const int64_t[:]
) -> np.ndarray: ...
def get_locale_names(name_type: str, locale: object = None): ...
def get_locale_names(name_type: str, locale: object = ...): ...

class RoundTo:
@property
Expand Down
20 changes: 10 additions & 10 deletions pandas/_libs/tslibs/period.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ class Period:
# error: "__new__" must return a class instance (got "Union[Period, NaTType]")
def __new__( # type: ignore[misc]
cls,
value=None,
freq=None,
ordinal=None,
year=None,
month=None,
quarter=None,
day=None,
hour=None,
minute=None,
second=None,
value=...,
freq=...,
ordinal=...,
year=...,
month=...,
quarter=...,
day=...,
hour=...,
minute=...,
second=...,
) -> Period | NaTType: ...
@classmethod
def _maybe_convert_freq(cls, freq) -> BaseOffset: ...
Expand Down
4 changes: 2 additions & 2 deletions pandas/_libs/tslibs/strptime.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ from pandas._typing import npt
def array_strptime(
values: npt.NDArray[np.object_],
fmt: str | None,
exact: bool = True,
errors: str = "raise",
exact: bool = ...,
errors: str = ...,
) -> tuple[np.ndarray, np.ndarray]: ...

# first ndarray is M8[ns], second is object ndarray of tzinfo | None
4 changes: 2 additions & 2 deletions pandas/_libs/tslibs/tzconversion.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ def tz_convert_from_utc_single(val: np.int64, tz: tzinfo) -> np.int64: ...
def tz_localize_to_utc(
vals: npt.NDArray[np.int64],
tz: tzinfo | None,
ambiguous: str | bool | Iterable[bool] | None = None,
nonexistent: str | timedelta | np.timedelta64 | None = None,
ambiguous: str | bool | Iterable[bool] | None = ...,
nonexistent: str | timedelta | np.timedelta64 | None = ...,
) -> npt.NDArray[np.int64]: ...
12 changes: 6 additions & 6 deletions pandas/_libs/tslibs/vectorized.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ def dt64arr_to_periodarr(
) -> npt.NDArray[np.int64]: ... # np.ndarray[np.int64, ndim=1]
def is_date_array_normalized(
stamps: npt.NDArray[np.int64], # const int64_t[:]
tz: tzinfo | None = None,
tz: tzinfo | None = ...,
) -> bool: ...
def normalize_i8_timestamps(
stamps: npt.NDArray[np.int64], # const int64_t[:]
tz: tzinfo | None,
) -> npt.NDArray[np.int64]: ...
def get_resolution(
stamps: npt.NDArray[np.int64], # const int64_t[:]
tz: tzinfo | None = None,
tz: tzinfo | None = ...,
) -> Resolution: ...
def ints_to_pydatetime(
arr: npt.NDArray[np.int64], # const int64_t[:}]
tz: tzinfo | None = None,
freq: str | BaseOffset | None = None,
fold: bool = False,
box: str = "datetime",
tz: tzinfo | None = ...,
freq: str | BaseOffset | None = ...,
fold: bool = ...,
box: str = ...,
) -> npt.NDArray[np.object_]: ...
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ reportFunctionMemberAccess = false
reportImportCycles = false
reportIncompatibleMethodOverride = false
reportIncompatibleVariableOverride = false
reportInvalidStubStatement = false
reportMissingImports = false
reportMissingModuleSource = false
reportMissingTypeArgument = false
Expand Down