diff --git a/pandas-stubs/_config/config.pyi b/pandas-stubs/_config/config.pyi index 3e6eb98f6..2889fc6ea 100644 --- a/pandas-stubs/_config/config.pyi +++ b/pandas-stubs/_config/config.pyi @@ -15,7 +15,7 @@ def reset_option(pat: str) -> None: ... @overload def describe_option(pat: str, _print_desc: Literal[False]) -> str: ... @overload -def describe_option(pat: str, _print_desc: Literal[True] = ...) -> None: ... +def describe_option(pat: str, _print_desc: Literal[True] = True) -> None: ... class DictWrapper: def __init__(self, d: dict[str, Any], prefix: str = ...) -> None: ... diff --git a/pandas-stubs/_testing/__init__.pyi b/pandas-stubs/_testing/__init__.pyi index 81969b55e..3db4eccbb 100644 --- a/pandas-stubs/_testing/__init__.pyi +++ b/pandas-stubs/_testing/__init__.pyi @@ -121,7 +121,7 @@ def assert_series_equal( obj: str = ..., *, check_index: Literal[False], - check_like: Literal[False] = ..., + check_like: Literal[False] = False, ) -> None: ... @overload def assert_series_equal( @@ -141,7 +141,7 @@ def assert_series_equal( atol: float = ..., obj: str = ..., *, - check_index: Literal[True] = ..., + check_index: Literal[True] = True, check_like: bool = ..., ) -> None: ... def assert_frame_equal( diff --git a/pandas-stubs/core/base.pyi b/pandas-stubs/core/base.pyi index ca81fff38..ea3865add 100644 --- a/pandas-stubs/core/base.pyi +++ b/pandas-stubs/core/base.pyi @@ -127,7 +127,7 @@ class IndexOpsMixin(OpsMixin, Generic[S1, GenericT_co]): @overload def value_counts( self, - normalize: Literal[False] = ..., + normalize: Literal[False] = False, sort: bool = ..., ascending: bool = ..., bins: int | None = ..., diff --git a/pandas-stubs/core/frame.pyi b/pandas-stubs/core/frame.pyi index 6e7ab1082..93af6f79d 100644 --- a/pandas-stubs/core/frame.pyi +++ b/pandas-stubs/core/frame.pyi @@ -458,7 +458,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): orient: str = ..., *, into: type[defaultdict], - index: Literal[True] = ..., + index: Literal[True] = True, ) -> Never: ... @overload def to_dict( @@ -466,7 +466,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): orient: Literal["records"], *, into: _T_MUTABLE_MAPPING_co | type[_T_MUTABLE_MAPPING_co], - index: Literal[True] = ..., + index: Literal[True] = True, ) -> list[_T_MUTABLE_MAPPING_co]: ... @overload def to_dict( @@ -474,7 +474,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): orient: Literal["records"], *, into: type[dict] = ..., - index: Literal[True] = ..., + index: Literal[True] = True, ) -> list[dict[Hashable, Any]]: ... @overload def to_dict( @@ -482,7 +482,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): orient: Literal["index"], *, into: defaultdict, - index: Literal[True] = ..., + index: Literal[True] = True, ) -> defaultdict[Hashable, dict[Hashable, Any]]: ... @overload def to_dict( @@ -490,7 +490,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): orient: Literal["index"], *, into: OrderedDict | type[OrderedDict], - index: Literal[True] = ..., + index: Literal[True] = True, ) -> OrderedDict[Hashable, dict[Hashable, Any]]: ... @overload def to_dict( @@ -498,7 +498,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): orient: Literal["index"], *, into: type[MutableMapping], - index: Literal[True] = ..., + index: Literal[True] = True, ) -> MutableMapping[Hashable, dict[Hashable, Any]]: ... @overload def to_dict( @@ -506,7 +506,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): orient: Literal["index"], *, into: type[dict] = ..., - index: Literal[True] = ..., + index: Literal[True] = True, ) -> dict[Hashable, dict[Hashable, Any]]: ... @overload def to_dict( @@ -514,7 +514,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): orient: Literal["dict", "list", "series"] = ..., *, into: _T_MUTABLE_MAPPING_co | type[_T_MUTABLE_MAPPING_co], - index: Literal[True] = ..., + index: Literal[True] = True, ) -> _T_MUTABLE_MAPPING_co: ... @overload def to_dict( @@ -522,7 +522,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): orient: Literal["dict", "list", "series"] = ..., *, into: type[dict] = ..., - index: Literal[True] = ..., + index: Literal[True] = True, ) -> dict[Hashable, Any]: ... @overload def to_dict( @@ -595,7 +595,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): data_label: _str | None = ..., variable_labels: dict[HashableT2, str] | None = ..., version: Literal[114, 117, 118, 119] | None = ..., - convert_strl: None = ..., + convert_strl: None = None, compression: CompressionOptions = ..., storage_options: StorageOptions = ..., value_labels: dict[Hashable, dict[float, str]] | None = ..., @@ -618,7 +618,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): @overload def to_parquet( self, - path: None = ..., + path: None = None, *, engine: ParquetEngine = ..., compression: Literal["snappy", "gzip", "brotli", "lz4", "zstd"] | None = ..., @@ -639,7 +639,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): @overload def to_orc( self, - path: None = ..., + path: None = None, *, engine: Literal["pyarrow"] = ..., index: bool | None = ..., @@ -696,7 +696,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): @overload def to_html( self, - buf: None = ..., + buf: None = None, *, columns: Sequence[Hashable] | None = ..., col_space: ColspaceArgType | None = ..., @@ -764,7 +764,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): @overload def to_xml( self, - path_or_buffer: None = ..., + path_or_buffer: None = None, index: bool = ..., root_name: str | None = ..., row_name: str | None = ..., @@ -818,7 +818,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): self, expr: _str, *, - inplace: Literal[False] = ..., + inplace: Literal[False] = False, parser: Literal["pandas", "python"] = ..., engine: Literal["python", "numexpr"] | None = ..., local_dict: dict[_str, Any] | None = ..., @@ -831,7 +831,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): def eval(self, expr: _str, *, inplace: Literal[True], **kwargs: Any) -> None: ... @overload def eval( - self, expr: _str, *, inplace: Literal[False] = ..., **kwargs: Any + self, expr: _str, *, inplace: Literal[False] = False, **kwargs: Any ) -> Scalar | np.ndarray | Self | Series: ... @overload def select_dtypes( @@ -916,7 +916,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): columns: Renamer | None = ..., axis: Axis | None = ..., copy: bool = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, level: Level | None = ..., errors: IgnoreRaise = ..., ) -> Self: ... @@ -936,7 +936,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): *, axis: Axis | None = ..., limit: int = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, ) -> Self: ... @overload def replace( @@ -953,7 +953,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): to_replace: ReplaceValue | Mapping[HashableT2, ReplaceValue] = ..., value: ReplaceValue | Mapping[HashableT3, ReplaceValue] = ..., *, - inplace: Literal[False] = ..., + inplace: Literal[False] = False, regex: ReplaceValue | Mapping[HashableT3, ReplaceValue] = ..., ) -> Self: ... def shift( @@ -995,7 +995,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): drop: _bool = ..., append: _bool = ..., verify_integrity: _bool = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, ) -> Self: ... @overload def reset_index( @@ -1017,7 +1017,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): col_level: int | _str = ..., col_fill: Hashable = ..., drop: _bool = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, allow_duplicates: _bool = ..., names: Hashable | Sequence[Hashable] = ..., ) -> Self: ... @@ -1044,7 +1044,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): how: AnyAll = ..., thresh: int | None = ..., subset: ListLikeU | Scalar | None = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, ignore_index: _bool = ..., ) -> Self: ... @overload @@ -1062,7 +1062,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): subset: Hashable | Iterable[Hashable] | None = ..., *, keep: DropKeep = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, ignore_index: _bool = ..., ) -> Self: ... def duplicated( @@ -1093,7 +1093,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): kind: SortKind = ..., na_position: NaPosition = ..., ignore_index: _bool = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, key: ValueKeyFunc = ..., ) -> Self: ... @overload @@ -1121,14 +1121,14 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): na_position: NaPosition = ..., sort_remaining: _bool = ..., ignore_index: _bool = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, key: IndexKeyFunc = ..., ) -> Self: ... @overload def value_counts( self, subset: Sequence[Hashable] | None = ..., - normalize: Literal[False] = ..., + normalize: Literal[False] = False, sort: _bool = ..., ascending: _bool = ..., dropna: _bool = ..., @@ -1196,7 +1196,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): self, by: Scalar, level: IndexLabel | None = ..., - as_index: Literal[False] = ..., + as_index: Literal[False] = False, sort: _bool = ..., group_keys: _bool = ..., observed: _bool | _NoDefaultDoNotUse = ..., @@ -1218,7 +1218,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): self, by: DatetimeIndex, level: IndexLabel | None = ..., - as_index: Literal[False] = ..., + as_index: Literal[False] = False, sort: _bool = ..., group_keys: _bool = ..., observed: _bool | _NoDefaultDoNotUse = ..., @@ -1240,7 +1240,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): self, by: TimedeltaIndex, level: IndexLabel | None = ..., - as_index: Literal[False] = ..., + as_index: Literal[False] = False, sort: _bool = ..., group_keys: _bool = ..., observed: _bool | _NoDefaultDoNotUse = ..., @@ -1262,7 +1262,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): self, by: PeriodIndex, level: IndexLabel | None = ..., - as_index: Literal[False] = ..., + as_index: Literal[False] = False, sort: _bool = ..., group_keys: _bool = ..., observed: _bool | _NoDefaultDoNotUse = ..., @@ -1284,7 +1284,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): self, by: IntervalIndex[IntervalT], level: IndexLabel | None = ..., - as_index: Literal[False] = ..., + as_index: Literal[False] = False, sort: _bool = ..., group_keys: _bool = ..., observed: _bool | _NoDefaultDoNotUse = ..., @@ -1306,7 +1306,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): self, by: MultiIndex | GroupByObjectNonScalar | None = ..., level: IndexLabel | None = ..., - as_index: Literal[False] = ..., + as_index: Literal[False] = False, sort: _bool = ..., group_keys: _bool = ..., observed: _bool | _NoDefaultDoNotUse = ..., @@ -1328,7 +1328,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): self, by: Series[SeriesByT], level: IndexLabel | None = ..., - as_index: Literal[False] = ..., + as_index: Literal[False] = False, sort: _bool = ..., group_keys: _bool = ..., observed: _bool | _NoDefaultDoNotUse = ..., @@ -1350,7 +1350,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): self, by: CategoricalIndex | Index | Series, level: IndexLabel | None = ..., - as_index: Literal[False] = ..., + as_index: Literal[False] = False, sort: _bool = ..., group_keys: _bool = ..., observed: _bool | _NoDefaultDoNotUse = ..., @@ -1389,7 +1389,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): level: IndexLabel = ..., dropna: _bool = ..., sort: _bool = ..., - future_stack: Literal[False] = ..., + future_stack: Literal[False] = False, ) -> Self | Series: ... def explode( self, column: Sequence[Hashable], ignore_index: _bool = False @@ -1453,7 +1453,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): f: Callable[..., ListLikeExceptSeriesAndStr | Series], axis: AxisIndex = ..., raw: _bool = ..., - result_type: None = ..., + result_type: None = None, args: Any = ..., **kwargs: Any, ) -> Self: ... @@ -1464,7 +1464,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): f: Callable[..., S2 | NAType], axis: AxisIndex = ..., raw: _bool = ..., - result_type: None = ..., + result_type: None = None, args: Any = ..., **kwargs: Any, ) -> Series[S2]: ... @@ -1476,7 +1476,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): f: Callable[..., Mapping[Any, Any]], axis: AxisIndex = ..., raw: _bool = ..., - result_type: None = ..., + result_type: None = None, args: Any = ..., **kwargs: Any, ) -> Series: ... @@ -1550,7 +1550,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): # Use S2 (TypeVar without `default=Any`) instead of S1 due to https://github.com/python/mypy/issues/19182. f: Callable[..., S2 | NAType], raw: _bool = ..., - result_type: None = ..., + result_type: None = None, args: Any = ..., *, axis: AxisColumn, @@ -1561,7 +1561,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): self, f: Callable[..., ListLikeExceptSeriesAndStr | Mapping[Any, Any]], raw: _bool = ..., - result_type: None = ..., + result_type: None = None, args: Any = ..., *, axis: AxisColumn, @@ -1572,7 +1572,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): self, f: Callable[..., Series], raw: _bool = ..., - result_type: None = ..., + result_type: None = None, args: Any = ..., *, axis: AxisColumn, @@ -1894,7 +1894,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): self, *, axis: Axis | None = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, limit: int | None = ..., limit_area: Literal["inside", "outside"] | None = ..., ) -> Self: ... @@ -1905,7 +1905,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): upper: float | None = ..., *, axis: Axis | None = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, **kwargs: Any, ) -> Self: ... @overload @@ -1915,7 +1915,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): upper: AnyArrayLike | None = ..., *, axis: Axis = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, **kwargs: Any, ) -> Self: ... @overload @@ -1925,14 +1925,14 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): upper: AnyArrayLike = ..., *, axis: Axis = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, **kwargs: Any, ) -> Self: ... @overload def clip( # pyright: ignore[reportOverlappingOverload] self, - lower: None = ..., - upper: None = ..., + lower: None = None, + upper: None = None, *, axis: Axis | None = ..., inplace: Literal[True], @@ -2057,7 +2057,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): self, *, axis: Axis | None = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, limit: int | None = ..., limit_area: Literal["inside", "outside"] | None = ..., ) -> Self: ... @@ -2081,11 +2081,11 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): ) -> Self: ... def ge(self, other, axis: Axis = "columns", level: Level | None = ...) -> Self: ... @overload - def get(self, key: Hashable, default: None = ...) -> Series | None: ... + def get(self, key: Hashable, default: None = None) -> Series | None: ... @overload def get(self, key: Hashable, default: _T) -> Series | _T: ... @overload - def get(self, key: list[Hashable], default: None = ...) -> Self | None: ... + def get(self, key: list[Hashable], default: None = None) -> Self | None: ... @overload def get(self, key: list[Hashable], default: _T) -> Self | _T: ... def gt(self, other, axis: Axis = "columns", level: Level | None = ...) -> Self: ... @@ -2114,7 +2114,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): limit: int | None = ..., limit_direction: Literal["forward", "backward", "both"] = ..., limit_area: Literal["inside", "outside"] | None = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, **kwargs: Any, ) -> Self: ... def keys(self) -> Index: ... @@ -2166,7 +2166,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): ), other: Scalar | Series | DataFrame | Callable | NAType | None = ..., *, - inplace: Literal[False] = ..., + inplace: Literal[False] = False, axis: Axis | None = ..., level: Level | None = ..., ) -> Self: ... @@ -2297,7 +2297,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): *, axis: Axis | None = ..., copy: _bool = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, ) -> Self: ... # Rename axis with `index` and/or `columns` and `inplace=True` @overload @@ -2317,7 +2317,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): index: _str | Sequence[_str] | dict[_str | int, _str] | Callable | None = ..., columns: _str | Sequence[_str] | dict[_str | int, _str] | Callable | None = ..., copy: _bool = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, ) -> Self: ... def rfloordiv( self, @@ -2366,7 +2366,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): step: int | None = ..., method: CalculationMethod = ..., *, - win_type: None = ..., + win_type: None = None, ) -> Rolling[Self]: ... def rpow( self, @@ -2453,7 +2453,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): @overload def to_json( self, - path_or_buf: None = ..., + path_or_buf: None = None, *, orient: Literal["records"], date_format: Literal["epoch", "iso"] | None = ..., @@ -2471,7 +2471,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): @overload def to_json( self, - path_or_buf: None = ..., + path_or_buf: None = None, *, orient: JsonFrameOrient | None = ..., date_format: Literal["epoch", "iso"] | None = ..., @@ -2531,7 +2531,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): @overload def to_string( self, - buf: None = ..., + buf: None = None, *, columns: Sequence[Hashable] | Index | Series | None = ..., col_space: int | list[int] | dict[Hashable, int] | None = ..., @@ -2623,7 +2623,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack): ), other=..., *, - inplace: Literal[False] = ..., + inplace: Literal[False] = False, axis: Axis | None = ..., level: Level | None = ..., ) -> Self: ... diff --git a/pandas-stubs/core/generic.pyi b/pandas-stubs/core/generic.pyi index 8cc612667..b44df48fe 100644 --- a/pandas-stubs/core/generic.pyi +++ b/pandas-stubs/core/generic.pyi @@ -150,7 +150,7 @@ class NDFrame(indexing.IndexingMixin): @overload def to_markdown( self, - buf: None = ..., + buf: None = None, *, mode: FileWriteMode | None = ..., index: _bool = ..., @@ -239,7 +239,7 @@ class NDFrame(indexing.IndexingMixin): @overload def to_latex( self, - buf: None = ..., + buf: None = None, columns: list[_str] | None = ..., header: _bool | list[_str] = ..., index: _bool = ..., @@ -289,7 +289,7 @@ class NDFrame(indexing.IndexingMixin): @overload def to_csv( self, - path_or_buf: None = ..., + path_or_buf: None = None, sep: _str = ..., na_rep: _str = ..., float_format: _str | Callable[[object], _str] | None = ..., @@ -352,7 +352,7 @@ class NDFrame(indexing.IndexingMixin): @overload def drop( self, - labels: None = ..., + labels: None = None, *, axis: Axis = ..., index: Hashable | Sequence[Hashable] | Index = ..., @@ -364,7 +364,7 @@ class NDFrame(indexing.IndexingMixin): @overload def drop( self, - labels: None = ..., + labels: None = None, *, axis: Axis = ..., index: Hashable | Sequence[Hashable] | Index, @@ -379,8 +379,8 @@ class NDFrame(indexing.IndexingMixin): labels: Hashable | Sequence[Hashable] | Index, *, axis: Axis = ..., - index: None = ..., - columns: None = ..., + index: None = None, + columns: None = None, level: Level | None = ..., inplace: Literal[True], errors: IgnoreRaise = ..., @@ -388,25 +388,25 @@ class NDFrame(indexing.IndexingMixin): @overload def drop( self, - labels: None = ..., + labels: None = None, *, axis: Axis = ..., index: Hashable | Sequence[Hashable] | Index = ..., columns: Hashable | Iterable[Hashable], level: Level | None = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, errors: IgnoreRaise = ..., ) -> Self: ... @overload def drop( self, - labels: None = ..., + labels: None = None, *, axis: Axis = ..., index: Hashable | Sequence[Hashable] | Index, columns: Hashable | Iterable[Hashable] = ..., level: Level | None = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, errors: IgnoreRaise = ..., ) -> Self: ... @overload @@ -415,10 +415,10 @@ class NDFrame(indexing.IndexingMixin): labels: Hashable | Sequence[Hashable] | Index, *, axis: Axis = ..., - index: None = ..., - columns: None = ..., + index: None = None, + columns: None = None, level: Level | None = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, errors: IgnoreRaise = ..., ) -> Self: ... @overload diff --git a/pandas-stubs/core/groupby/generic.pyi b/pandas-stubs/core/groupby/generic.pyi index 76e543ae8..7c058cd79 100644 --- a/pandas-stubs/core/groupby/generic.pyi +++ b/pandas-stubs/core/groupby/generic.pyi @@ -132,7 +132,7 @@ class SeriesGroupBy(GroupBy[Series[S2]], Generic[S2, ByT]): @overload def value_counts( self, - normalize: Literal[False] = ..., + normalize: Literal[False] = False, sort: bool = ..., ascending: bool = ..., bins: int | Sequence[int] | None = ..., @@ -314,7 +314,7 @@ class DataFrameGroupBy(GroupBy[DataFrame], Generic[ByT, _TT]): @overload def boxplot( self, - subplots: Literal[True] = ..., + subplots: Literal[True] = True, column: IndexLabel | None = ..., fontsize: float | str | None = ..., rot: float = ..., @@ -363,7 +363,7 @@ class DataFrameGroupBy(GroupBy[DataFrame], Generic[ByT, _TT]): def value_counts( self: DataFrameGroupBy[ByT, Literal[True]], subset: ListLike | None = ..., - normalize: Literal[False] = ..., + normalize: Literal[False] = False, sort: bool = ..., ascending: bool = ..., dropna: bool = ..., @@ -381,7 +381,7 @@ class DataFrameGroupBy(GroupBy[DataFrame], Generic[ByT, _TT]): def value_counts( self: DataFrameGroupBy[ByT, Literal[False]], subset: ListLike | None = ..., - normalize: Literal[False] = ..., + normalize: Literal[False] = False, sort: bool = ..., ascending: bool = ..., dropna: bool = ..., @@ -411,7 +411,7 @@ class DataFrameGroupBy(GroupBy[DataFrame], Generic[ByT, _TT]): skipna: bool = ..., numeric_only: bool = ..., *, - level: None = ..., + level: None = None, **kwargs: Any, ) -> Series: ... @property diff --git a/pandas-stubs/core/indexes/datetimes.pyi b/pandas-stubs/core/indexes/datetimes.pyi index 4ff9bc44f..58166f29f 100644 --- a/pandas-stubs/core/indexes/datetimes.pyi +++ b/pandas-stubs/core/indexes/datetimes.pyi @@ -158,7 +158,7 @@ def bdate_range( normalize: bool = ..., name: Hashable | None = ..., weekmask: str | None = ..., - holidays: None = ..., + holidays: None = None, inclusive: IntervalClosedType = ..., ) -> DatetimeIndex: ... @overload diff --git a/pandas-stubs/core/indexes/interval.pyi b/pandas-stubs/core/indexes/interval.pyi index 628d588ec..bfad205cd 100644 --- a/pandas-stubs/core/indexes/interval.pyi +++ b/pandas-stubs/core/indexes/interval.pyi @@ -336,7 +336,7 @@ def interval_range( @overload def interval_range( *, - start: None = ..., + start: None = None, end: _TimestampLike, periods: int | None = ..., freq: Frequency | dt.timedelta | None = ..., @@ -355,7 +355,7 @@ def interval_range( @overload def interval_range( *, - start: None = ..., + start: None = None, end: _TimedeltaLike, periods: int | None = ..., freq: Frequency | dt.timedelta | None = ..., diff --git a/pandas-stubs/core/resample.pyi b/pandas-stubs/core/resample.pyi index e823e5243..91299803e 100644 --- a/pandas-stubs/core/resample.pyi +++ b/pandas-stubs/core/resample.pyi @@ -113,7 +113,7 @@ class Resampler(BaseGroupBy[NDFrameT]): *, axis: Axis = ..., limit: int | None = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, limit_direction: Literal["forward", "backward", "both"] = ..., limit_area: Literal["inside", "outside"] | None = ..., **kwargs: Any, diff --git a/pandas-stubs/core/reshape/merge.pyi b/pandas-stubs/core/reshape/merge.pyi index cf5243cd2..96b7a70dc 100644 --- a/pandas-stubs/core/reshape/merge.pyi +++ b/pandas-stubs/core/reshape/merge.pyi @@ -54,8 +54,8 @@ def merge_ordered( on: Label | list[HashableT] | None = ..., left_on: Label | list[HashableT] | None = ..., right_on: Label | list[HashableT] | None = ..., - left_by: None = ..., - right_by: None = ..., + left_by: None = None, + right_by: None = None, fill_method: Literal["ffill"] | None = ..., suffixes: ( list[str | None] | tuple[str, str] | tuple[None, str] | tuple[str, None] @@ -69,8 +69,8 @@ def merge_ordered( on: Label | list[HashableT] | None = ..., left_on: Label | list[HashableT] | None = ..., right_on: Label | list[HashableT] | None = ..., - left_by: None = ..., - right_by: None = ..., + left_by: None = None, + right_by: None = None, fill_method: Literal["ffill"] | None = ..., suffixes: Suffixes = ..., how: JoinHow = ..., diff --git a/pandas-stubs/core/reshape/pivot.pyi b/pandas-stubs/core/reshape/pivot.pyi index 2c2157b3d..8e8382798 100644 --- a/pandas-stubs/core/reshape/pivot.pyi +++ b/pandas-stubs/core/reshape/pivot.pyi @@ -138,10 +138,10 @@ def crosstab( def crosstab( index: list | _ExtendedAnyArrayLike | list[Sequence | _ExtendedAnyArrayLike], columns: list | _ExtendedAnyArrayLike | list[Sequence | _ExtendedAnyArrayLike], - values: None = ..., + values: None = None, rownames: list[HashableT1] | None = ..., colnames: list[HashableT2] | None = ..., - aggfunc: None = ..., + aggfunc: None = None, margins: bool = ..., margins_name: str = ..., dropna: bool = ..., diff --git a/pandas-stubs/core/reshape/tile.pyi b/pandas-stubs/core/reshape/tile.pyi index da7d83f16..0eed14683 100644 --- a/pandas-stubs/core/reshape/tile.pyi +++ b/pandas-stubs/core/reshape/tile.pyi @@ -147,7 +147,7 @@ def cut( right: bool = ..., *, labels: Literal[False], - retbins: Literal[False] = ..., + retbins: Literal[False] = False, precision: int = ..., include_lowest: bool = ..., duplicates: Literal["raise", "drop"] = ..., @@ -166,7 +166,7 @@ def cut( ), right: bool = ..., labels: Literal[False] | Sequence[Label] | None = ..., - retbins: Literal[False] = ..., + retbins: Literal[False] = False, precision: int = ..., include_lowest: bool = ..., duplicates: Literal["raise", "drop"] = ..., @@ -186,7 +186,7 @@ def cut( ), right: bool = ..., labels: Literal[False] | Sequence[Label] | None = ..., - retbins: Literal[False] = ..., + retbins: Literal[False] = False, precision: int = ..., include_lowest: bool = ..., duplicates: Literal["raise", "drop"] = ..., @@ -206,7 +206,7 @@ def cut( ), right: bool = ..., labels: Sequence[Label] | None = ..., - retbins: Literal[False] = ..., + retbins: Literal[False] = False, precision: int = ..., include_lowest: bool = ..., duplicates: Literal["raise", "drop"] = ..., @@ -218,7 +218,7 @@ def qcut( q: int | Sequence[float] | Series[float] | Index[float] | npt.NDArray, *, labels: Literal[False], - retbins: Literal[False] = ..., + retbins: Literal[False] = False, precision: int = ..., duplicates: Literal["raise", "drop"] = ..., ) -> npt.NDArray[np.intp]: ... @@ -227,7 +227,7 @@ def qcut( x: Index | npt.NDArray | Sequence[int] | Sequence[float], q: int | Sequence[float] | Series[float] | Index[float] | npt.NDArray, labels: Sequence[Label] | None = ..., - retbins: Literal[False] = ..., + retbins: Literal[False] = False, precision: int = ..., duplicates: Literal["raise", "drop"] = ..., ) -> Categorical: ... @@ -236,7 +236,7 @@ def qcut( x: Series, q: int | Sequence[float] | Series[float] | Index[float] | npt.NDArray, labels: Literal[False] | Sequence[Label] | None = ..., - retbins: Literal[False] = ..., + retbins: Literal[False] = False, precision: int = ..., duplicates: Literal["raise", "drop"] = ..., ) -> Series: ... diff --git a/pandas-stubs/core/series.pyi b/pandas-stubs/core/series.pyi index 30f9722b7..c05af4813 100644 --- a/pandas-stubs/core/series.pyi +++ b/pandas-stubs/core/series.pyi @@ -541,7 +541,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): def __getitem__(self, idx: Scalar) -> S1: ... def __setitem__(self, key, value) -> None: ... @overload - def get(self, key: Hashable, default: None = ...) -> S1 | None: ... + def get(self, key: Hashable, default: None = None) -> S1 | None: ... @overload def get(self, key: Hashable, default: S1) -> S1: ... @overload @@ -560,9 +560,9 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): self, level: Sequence[Level] | Level | None = ..., *, - drop: Literal[False] = ..., + drop: Literal[False] = False, name: Level = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, allow_duplicates: bool = ..., ) -> DataFrame: ... @overload @@ -572,7 +572,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): *, drop: Literal[True], name: Level = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, allow_duplicates: bool = ..., ) -> Series[S1]: ... @overload @@ -602,7 +602,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): @overload def to_string( self, - buf: None = ..., + buf: None = None, na_rep: _str = ..., float_format: FloatFormatType = ..., header: _bool = ..., @@ -633,7 +633,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): @overload def to_json( self, - path_or_buf: None = ..., + path_or_buf: None = None, *, orient: Literal["records"], date_format: Literal["epoch", "iso"] | None = ..., @@ -667,7 +667,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): @overload def to_json( self, - path_or_buf: None = ..., + path_or_buf: None = None, *, orient: JsonSeriesOrient | None = ..., date_format: Literal["epoch", "iso"] | None = ..., @@ -772,7 +772,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): @overload def groupby( self, - by: None = ..., + by: None = None, *, level: IndexLabel, # level is required when by=None (passed as keyword) as_index: _bool = ..., @@ -826,7 +826,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): self, *, keep: DropKeep = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, ignore_index: _bool = ..., ) -> Series[S1]: ... def duplicated(self, keep: DropKeep = "first") -> Series[_bool]: ... @@ -961,7 +961,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): kind: SortKind = ..., na_position: NaPosition = ..., ignore_index: _bool = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, key: ValueKeyFunc = ..., ) -> Series[S1]: ... @overload @@ -989,7 +989,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): na_position: NaPosition = ..., sort_remaining: _bool = ..., ignore_index: _bool = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, key: IndexKeyFunc = ..., ) -> Series[S1]: ... def argsort( @@ -1026,7 +1026,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): def map( self, arg: Callable[[S1 | NAType], S2 | NAType] | Mapping[S1, S2] | Series[S2], - na_action: None = ..., + na_action: None = None, ) -> Series[S2]: ... @overload def map( @@ -1151,7 +1151,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): *, axis: Axis | None = ..., copy: bool = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, level: Level | None = ..., errors: IgnoreRaise = ..., ) -> Self: ... @@ -1180,7 +1180,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): *, axis: AxisIndex = ..., limit: int | None = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, ) -> Series[S1]: ... @overload def replace( @@ -1198,7 +1198,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): value: ReplaceValue = ..., *, regex: ReplaceValue = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, ) -> Series[S1]: ... def shift( self, @@ -1240,7 +1240,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): self, *, axis: AxisIndex = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, how: AnyAll | None = ..., ignore_index: _bool = ..., ) -> Series[S1]: ... @@ -1420,7 +1420,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): self, *, axis: AxisIndex | None = 0, - inplace: Literal[False] = ..., + inplace: Literal[False] = False, limit: int | None = ..., limit_area: Literal["inside", "outside"] | None = ..., ) -> Series[S1]: ... @@ -1438,7 +1438,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): self, *, axis: AxisIndex | None = 0, - inplace: Literal[False] = ..., + inplace: Literal[False] = False, limit: int | None = ..., limit_area: Literal["inside", "outside"] | None = ..., ) -> Series[S1]: ... @@ -1461,7 +1461,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): *, axis: AxisIndex | None = 0, limit: int | None = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, limit_direction: Literal["forward", "backward", "both"] | None = ..., limit_area: Literal["inside", "outside"] | None = ..., **kwargs: Any, @@ -1475,8 +1475,8 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): @overload def clip( # pyright: ignore[reportOverlappingOverload] self, - lower: None = ..., - upper: None = ..., + lower: None = None, + upper: None = None, *, axis: AxisIndex | None = 0, inplace: Literal[True], @@ -1499,7 +1499,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): upper: AnyArrayLike | float | None = ..., *, axis: AxisIndex | None = 0, - inplace: Literal[False] = ..., + inplace: Literal[False] = False, **kwargs: Any, ) -> Series[S1]: ... @final @@ -1568,7 +1568,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): ), other=..., *, - inplace: Literal[False] = ..., + inplace: Literal[False] = False, axis: AxisIndex | None = 0, level: Level | None = ..., ) -> Self: ... @@ -1600,7 +1600,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): ), other: Scalar | Series[S1] | DataFrame | Callable | NAType | None = ..., *, - inplace: Literal[False] = ..., + inplace: Literal[False] = False, axis: AxisIndex | None = 0, level: Level | None = ..., ) -> Series[S1]: ... @@ -1664,7 +1664,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): @overload def value_counts( # pyrefly: ignore self, - normalize: Literal[False] = ..., + normalize: Literal[False] = False, sort: _bool = ..., ascending: _bool = ..., bins: int | None = ..., @@ -4237,7 +4237,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): self, axis: AxisIndex | None = 0, skipna: _bool = True, - level: None = ..., + level: None = None, numeric_only: _bool = False, **kwargs: Any, ) -> S1: ... @@ -4246,7 +4246,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): self: Series[Never], axis: AxisIndex | None = ..., skipna: _bool = ..., - level: None = ..., + level: None = None, numeric_only: _bool = False, **kwargs: Any, ) -> float: ... @@ -4255,7 +4255,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): self: Series[Timestamp], axis: AxisIndex | None = ..., skipna: _bool = ..., - level: None = ..., + level: None = None, numeric_only: _bool = False, **kwargs: Any, ) -> Timestamp: ... @@ -4264,7 +4264,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): self: SupportsGetItem[Scalar, SupportsTruedivInt[S2]], axis: AxisIndex | None = 0, skipna: _bool = True, - level: None = ..., + level: None = None, numeric_only: _bool = False, **kwargs: Any, ) -> S2: ... @@ -4273,7 +4273,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): self: Series[Never], axis: AxisIndex | None = 0, skipna: _bool = True, - level: None = ..., + level: None = None, numeric_only: _bool = False, **kwargs: Any, ) -> float: ... @@ -4282,7 +4282,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): self: Series[complex], axis: AxisIndex | None = 0, skipna: _bool = True, - level: None = ..., + level: None = None, numeric_only: _bool = False, **kwargs: Any, ) -> float: ... @@ -4291,7 +4291,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): self: SupportsGetItem[Scalar, SupportsTruedivInt[S2]], axis: AxisIndex | None = 0, skipna: _bool = True, - level: None = ..., + level: None = None, numeric_only: _bool = False, **kwargs: Any, ) -> S2: ... @@ -4300,7 +4300,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): self: Series[Timestamp], axis: AxisIndex | None = 0, skipna: _bool = True, - level: None = ..., + level: None = None, numeric_only: _bool = False, **kwargs: Any, ) -> Timestamp: ... @@ -4308,7 +4308,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): self, axis: AxisIndex | None = 0, skipna: _bool = True, - level: None = ..., + level: None = None, numeric_only: _bool = False, **kwargs: Any, ) -> S1: ... @@ -4389,7 +4389,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): step: int | None = ..., method: CalculationMethod = ..., *, - win_type: None = ..., + win_type: None = None, ) -> Rolling[Series]: ... def rpow( self, @@ -4427,7 +4427,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): self: Series[complex], axis: AxisIndex | None = 0, skipna: _bool | None = True, - level: None = ..., + level: None = None, ddof: int = ..., numeric_only: _bool = False, **kwargs: Any, @@ -4437,7 +4437,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): self: Series[Timestamp], axis: AxisIndex | None = 0, skipna: _bool | None = True, - level: None = ..., + level: None = None, ddof: int = ..., numeric_only: _bool = False, **kwargs: Any, @@ -4583,7 +4583,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): *, axis: AxisIndex | None = 0, copy: _bool = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, ) -> Self: ... # Rename axis with `index` and `inplace=True` @overload @@ -4601,7 +4601,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame): *, index: Scalar | ListLike | Callable | dict | None = ..., copy: _bool = ..., - inplace: Literal[False] = ..., + inplace: Literal[False] = False, ) -> Self: ... def set_axis(self, labels, *, axis: Axis = ..., copy: _bool = ...) -> Self: ... @final diff --git a/pandas-stubs/core/window/ewm.pyi b/pandas-stubs/core/window/ewm.pyi index ea7e3b0ce..4da054040 100644 --- a/pandas-stubs/core/window/ewm.pyi +++ b/pandas-stubs/core/window/ewm.pyi @@ -70,6 +70,6 @@ class OnlineExponentialMovingWindow(ExponentialMovingWindow[NDFrameT]): self, *args: Any, update: NDFrameT | None = ..., - update_times: None = ..., + update_times: None = None, **kwargs: Any, ) -> NDFrameT: ... diff --git a/pandas-stubs/io/clipboards.pyi b/pandas-stubs/io/clipboards.pyi index ddb78d03a..7f57c2845 100644 --- a/pandas-stubs/io/clipboards.pyi +++ b/pandas-stubs/io/clipboards.pyi @@ -180,8 +180,8 @@ def read_clipboard( date_parser: Callable = ..., dayfirst: bool = ..., cache_dates: bool = ..., - iterator: Literal[False] = ..., - chunksize: None = ..., + iterator: Literal[False] = False, + chunksize: None = None, compression: CompressionOptions = ..., thousands: str | None = ..., decimal: str = ..., diff --git a/pandas-stubs/io/formats/style.pyi b/pandas-stubs/io/formats/style.pyi index 7609cb4a3..02ff658f7 100644 --- a/pandas-stubs/io/formats/style.pyi +++ b/pandas-stubs/io/formats/style.pyi @@ -142,7 +142,7 @@ class Styler(StylerRenderer): @overload def to_latex( self, - buf: None = ..., + buf: None = None, *, column_format: str | None = ..., position: str | None = ..., @@ -183,7 +183,7 @@ class Styler(StylerRenderer): @overload def to_html( self, - buf: None = ..., + buf: None = None, *, table_uuid: str | None = ..., table_attributes: str | None = ..., @@ -213,7 +213,7 @@ class Styler(StylerRenderer): @overload def to_string( self, - buf: None = ..., + buf: None = None, *, encoding: str | None = ..., sparse_index: bool | None = ..., diff --git a/pandas-stubs/io/json/_json.pyi b/pandas-stubs/io/json/_json.pyi index 03659ec37..aabebb978 100644 --- a/pandas-stubs/io/json/_json.pyi +++ b/pandas-stubs/io/json/_json.pyi @@ -143,7 +143,7 @@ def read_json( | None ) = ..., lines: bool = ..., - chunksize: None = ..., + chunksize: None = None, compression: CompressionOptions = ..., nrows: int | None = ..., storage_options: StorageOptions = ..., @@ -168,7 +168,7 @@ def read_json( | None ) = ..., lines: Literal[True], - chunksize: None = ..., + chunksize: None = None, compression: CompressionOptions = ..., nrows: int | None = ..., storage_options: StorageOptions = ..., @@ -193,7 +193,7 @@ def read_json( | None ) = ..., lines: bool = ..., - chunksize: None = ..., + chunksize: None = None, compression: CompressionOptions = ..., nrows: int | None = ..., storage_options: StorageOptions = ..., @@ -218,7 +218,7 @@ def read_json( | None ) = ..., lines: Literal[True], - chunksize: None = ..., + chunksize: None = None, compression: CompressionOptions = ..., nrows: int | None = ..., storage_options: StorageOptions = ..., diff --git a/pandas-stubs/io/parsers/readers.pyi b/pandas-stubs/io/parsers/readers.pyi index c3ad7f391..1584c76ab 100644 --- a/pandas-stubs/io/parsers/readers.pyi +++ b/pandas-stubs/io/parsers/readers.pyi @@ -205,8 +205,8 @@ def read_csv( date_format: dict[Hashable, str] | str | None = ..., dayfirst: bool = ..., cache_dates: bool = ..., - iterator: Literal[False] = ..., - chunksize: None = ..., + iterator: Literal[False] = False, + chunksize: None = None, compression: CompressionOptions = ..., thousands: str | None = ..., decimal: str = ..., @@ -401,8 +401,8 @@ def read_table( date_format: dict[Hashable, str] | str | None = ..., dayfirst: bool = ..., cache_dates: bool = ..., - iterator: Literal[False] = ..., - chunksize: None = ..., + iterator: Literal[False] = False, + chunksize: None = None, compression: CompressionOptions = ..., thousands: str | None = ..., decimal: str = ..., @@ -459,8 +459,8 @@ def read_fwf( infer_nrows: int = ..., dtype_backend: DtypeBackend | _NoDefaultDoNotUse = ..., date_format: dict[Hashable, str] | str | None = ..., - iterator: Literal[False] = ..., - chunksize: None = ..., + iterator: Literal[False] = False, + chunksize: None = None, **kwds: Any, ) -> DataFrame: ... diff --git a/pandas-stubs/io/pytables.pyi b/pandas-stubs/io/pytables.pyi index 006620f78..83e36a4fe 100644 --- a/pandas-stubs/io/pytables.pyi +++ b/pandas-stubs/io/pytables.pyi @@ -93,8 +93,8 @@ def read_hdf( start: int | None = ..., stop: int | None = ..., columns: list[HashableT] | None = ..., - iterator: Literal[False] = ..., - chunksize: None = ..., + iterator: Literal[False] = False, + chunksize: None = None, **kwargs: Any, ) -> DataFrame | Series: ... @@ -162,8 +162,8 @@ class HDFStore: start: int | None = ..., stop: int | None = ..., columns: list[HashableT] | None = ..., - iterator: Literal[False] = ..., - chunksize: None = ..., + iterator: Literal[False] = False, + chunksize: None = None, auto_close: bool = ..., ) -> DataFrame | Series: ... def put( diff --git a/pandas-stubs/io/sas/sasreader.pyi b/pandas-stubs/io/sas/sasreader.pyi index 7865aaa64..3cb02546c 100644 --- a/pandas-stubs/io/sas/sasreader.pyi +++ b/pandas-stubs/io/sas/sasreader.pyi @@ -54,7 +54,7 @@ def read_sas( def read_sas( filepath_or_buffer: FilePath | ReadBuffer[bytes], *, - format: None = ..., + format: None = None, index: Hashable | None = ..., encoding: str | None = ..., chunksize: int, @@ -87,7 +87,7 @@ def read_sas( def read_sas( filepath_or_buffer: FilePath | ReadBuffer[bytes], *, - format: None = ..., + format: None = None, index: Hashable | None = ..., encoding: str | None = ..., chunksize: int | None = ..., @@ -101,7 +101,7 @@ def read_sas( format: Literal["xport", "sas7bdat"] | None = ..., index: Hashable | None = ..., encoding: str | None = ..., - chunksize: None = ..., - iterator: Literal[False] = ..., + chunksize: None = None, + iterator: Literal[False] = False, compression: CompressionOptions = ..., ) -> DataFrame: ... diff --git a/pandas-stubs/io/sql.pyi b/pandas-stubs/io/sql.pyi index 5dadb15c7..a201e7bd4 100644 --- a/pandas-stubs/io/sql.pyi +++ b/pandas-stubs/io/sql.pyi @@ -58,7 +58,7 @@ def read_sql_table( coerce_float: bool = ..., parse_dates: list[str] | dict[str, str] | dict[str, dict[str, Any]] | None = ..., columns: list[str] | None = ..., - chunksize: None = ..., + chunksize: None = None, dtype_backend: DtypeBackend | _NoDefaultDoNotUse = ..., ) -> DataFrame: ... @overload @@ -96,7 +96,7 @@ def read_sql_query( | None ) = ..., parse_dates: list[str] | dict[str, str] | dict[str, dict[str, Any]] | None = ..., - chunksize: None = ..., + chunksize: None = None, dtype: DtypeArg | None = ..., dtype_backend: DtypeBackend | _NoDefaultDoNotUse = ..., ) -> DataFrame: ... @@ -137,7 +137,7 @@ def read_sql( ) = ..., parse_dates: list[str] | dict[str, str] | dict[str, dict[str, Any]] | None = ..., columns: list[str] | None = ..., - chunksize: None = ..., + chunksize: None = None, dtype: DtypeArg | None = ..., dtype_backend: DtypeBackend | _NoDefaultDoNotUse = ..., ) -> DataFrame: ... diff --git a/pandas-stubs/io/stata.pyi b/pandas-stubs/io/stata.pyi index 9874a0452..ce50b8083 100644 --- a/pandas-stubs/io/stata.pyi +++ b/pandas-stubs/io/stata.pyi @@ -67,8 +67,8 @@ def read_stata( preserve_dtypes: bool = ..., columns: list[HashableT] | None = ..., order_categoricals: bool = ..., - chunksize: None = ..., - iterator: Literal[False] = ..., + chunksize: None = None, + iterator: Literal[False] = False, compression: CompressionOptions = ..., storage_options: StorageOptions = ..., ) -> DataFrame: ... diff --git a/pandas-stubs/tseries/holiday.pyi b/pandas-stubs/tseries/holiday.pyi index f2e0eb036..29547591d 100644 --- a/pandas-stubs/tseries/holiday.pyi +++ b/pandas-stubs/tseries/holiday.pyi @@ -58,7 +58,7 @@ class Holiday: self, start_date: np.integer | float | str | _date | datetime | np.datetime64 | None, end_date: np.integer | float | str | _date | datetime | np.datetime64 | None, - return_name: Literal[True] = ..., + return_name: Literal[True] = True, ) -> Series: ... holiday_calendars: dict[str, type[AbstractHolidayCalendar]] @@ -86,7 +86,7 @@ class AbstractHolidayCalendar: self, start: datetime | None = ..., end: datetime | None = ..., - return_name: Literal[False] = ..., + return_name: Literal[False] = False, ) -> DatetimeIndex: ... @staticmethod def merge_class( @@ -103,7 +103,7 @@ class AbstractHolidayCalendar: def merge( self, other: AbstractHolidayCalendar | type[AbstractHolidayCalendar], - inplace: Literal[False] = ..., + inplace: Literal[False] = False, ) -> list[Holiday]: ... USMemorialDay: Holiday