diff --git a/pandas/_libs/algos.pyi b/pandas/_libs/algos.pyi index fdec60a84a708..bff7d117c97da 100644 --- a/pandas/_libs/algos.pyi +++ b/pandas/_libs/algos.pyi @@ -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] # ---------------------------------------------------------------------- @@ -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] @@ -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: ... diff --git a/pandas/_libs/arrays.pyi b/pandas/_libs/arrays.pyi index 67af9653fc75a..76e4321cc0c77 100644 --- a/pandas/_libs/arrays.pyi +++ b/pandas/_libs/arrays.pyi @@ -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): ... diff --git a/pandas/_libs/index.pyi b/pandas/_libs/index.pyi index 752f339ff31da..18ee216d5c4a1 100644 --- a/pandas/_libs/index.pyi +++ b/pandas/_libs/index.pyi @@ -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: ... diff --git a/pandas/_libs/internals.pyi b/pandas/_libs/internals.pyi index da18084da92f9..6a90fbc729580 100644 --- a/pandas/_libs/internals.pyi +++ b/pandas/_libs/internals.pyi @@ -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: ... diff --git a/pandas/_libs/join.pyi b/pandas/_libs/join.pyi index 5b0e50ca76840..3a22aa439b7be 100644 --- a/pandas/_libs/join.pyi +++ b/pandas/_libs/join.pyi @@ -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[:] @@ -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]]: ... diff --git a/pandas/_libs/lib.pyi b/pandas/_libs/lib.pyi index 25fdec1bfca63..e60250169edd1 100644 --- a/pandas/_libs/lib.pyi +++ b/pandas/_libs/lib.pyi @@ -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: ... @@ -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( @@ -131,16 +131,16 @@ 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]: ... @@ -148,10 +148,10 @@ def maybe_convert_numeric( # 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_], @@ -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], @@ -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[:] diff --git a/pandas/_libs/sparse.pyi b/pandas/_libs/sparse.pyi index aff1ed6cef74c..c75c36bd61fcd 100644 --- a/pandas/_libs/sparse.pyi +++ b/pandas/_libs/sparse.pyi @@ -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): diff --git a/pandas/_libs/tslibs/fields.pyi b/pandas/_libs/tslibs/fields.pyi index c6ebb1618f1f2..cbf91f2bcaf76 100644 --- a/pandas/_libs/tslibs/fields.pyi +++ b/pandas/_libs/tslibs/fields.pyi @@ -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 diff --git a/pandas/_libs/tslibs/period.pyi b/pandas/_libs/tslibs/period.pyi index e5455fa55c5ef..4f7505fd7e792 100644 --- a/pandas/_libs/tslibs/period.pyi +++ b/pandas/_libs/tslibs/period.pyi @@ -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: ... diff --git a/pandas/_libs/tslibs/strptime.pyi b/pandas/_libs/tslibs/strptime.pyi index fd88bc6938294..8e1acb2ff0d38 100644 --- a/pandas/_libs/tslibs/strptime.pyi +++ b/pandas/_libs/tslibs/strptime.pyi @@ -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 diff --git a/pandas/_libs/tslibs/tzconversion.pyi b/pandas/_libs/tslibs/tzconversion.pyi index 614c97a1ae0cc..e1a0263cf59ef 100644 --- a/pandas/_libs/tslibs/tzconversion.pyi +++ b/pandas/_libs/tslibs/tzconversion.pyi @@ -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]: ... diff --git a/pandas/_libs/tslibs/vectorized.pyi b/pandas/_libs/tslibs/vectorized.pyi index a53bab26ff42b..e9a39a6a75a39 100644 --- a/pandas/_libs/tslibs/vectorized.pyi +++ b/pandas/_libs/tslibs/vectorized.pyi @@ -17,7 +17,7 @@ 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[:] @@ -25,12 +25,12 @@ def normalize_i8_timestamps( ) -> 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_]: ... diff --git a/pyproject.toml b/pyproject.toml index 717ad27c9d7e9..93a7805a63da3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -165,7 +165,6 @@ reportFunctionMemberAccess = false reportImportCycles = false reportIncompatibleMethodOverride = false reportIncompatibleVariableOverride = false -reportInvalidStubStatement = false reportMissingImports = false reportMissingModuleSource = false reportMissingTypeArgument = false