From fbe337317fe6230ac94cd42966b309e584bbe43a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Diridollou?= Date: Fri, 14 Nov 2025 15:59:34 -0500 Subject: [PATCH] GH1317 Set defaults --- pandas-stubs/core/indexes/interval.pyi | 60 ++-- pandas-stubs/io/parsers/readers.pyi | 380 ++++++++++++------------- pandas-stubs/io/sql.pyi | 18 +- 3 files changed, 229 insertions(+), 229 deletions(-) diff --git a/pandas-stubs/core/indexes/interval.pyi b/pandas-stubs/core/indexes/interval.pyi index 193ceb08e..2c4381c62 100644 --- a/pandas-stubs/core/indexes/interval.pyi +++ b/pandas-stubs/core/indexes/interval.pyi @@ -295,57 +295,57 @@ class IntervalIndex(ExtensionIndex[IntervalT, np.object_], IntervalMixin): # int gets hit first and so the correct type is returned @overload def interval_range( # pyright: ignore[reportOverlappingOverload] - start: int | None = ..., - end: int | None = ..., - periods: int | None = ..., - freq: int | None = ..., - name: Hashable = ..., - closed: IntervalClosedType = ..., + start: int | None = None, + end: int | None = None, + periods: int | None = None, + freq: int | None = None, + name: Hashable = None, + closed: IntervalClosedType = "right", ) -> IntervalIndex[Interval[int]]: ... @overload def interval_range( - start: float | None = ..., - end: float | None = ..., - periods: int | None = ..., - freq: int | None = ..., - name: Hashable = ..., - closed: IntervalClosedType = ..., + start: float | None = None, + end: float | None = None, + periods: int | None = None, + freq: int | None = None, + name: Hashable = None, + closed: IntervalClosedType = "right", ) -> IntervalIndex[Interval[float]]: ... @overload def interval_range( start: _TimestampLike, - end: _TimestampLike | None = ..., - periods: int | None = ..., - freq: Frequency | dt.timedelta | None = ..., - name: Hashable = ..., - closed: IntervalClosedType = ..., + end: _TimestampLike | None = None, + periods: int | None = None, + freq: Frequency | dt.timedelta | None = None, + name: Hashable = None, + closed: IntervalClosedType = "right", ) -> IntervalIndex[Interval[pd.Timestamp]]: ... @overload def interval_range( *, start: None = None, end: _TimestampLike, - periods: int | None = ..., - freq: Frequency | dt.timedelta | None = ..., - name: Hashable = ..., - closed: IntervalClosedType = ..., + periods: int | None = None, + freq: Frequency | dt.timedelta | None = None, + name: Hashable = None, + closed: IntervalClosedType = "right", ) -> IntervalIndex[Interval[pd.Timestamp]]: ... @overload def interval_range( start: _TimedeltaLike, - end: _TimedeltaLike | None = ..., - periods: int | None = ..., - freq: Frequency | dt.timedelta | None = ..., - name: Hashable = ..., - closed: IntervalClosedType = ..., + end: _TimedeltaLike | None = None, + periods: int | None = None, + freq: Frequency | dt.timedelta | None = None, + name: Hashable = None, + closed: IntervalClosedType = "right", ) -> IntervalIndex[Interval[pd.Timedelta]]: ... @overload def interval_range( *, start: None = None, end: _TimedeltaLike, - periods: int | None = ..., - freq: Frequency | dt.timedelta | None = ..., - name: Hashable = ..., - closed: IntervalClosedType = ..., + periods: int | None = None, + freq: Frequency | dt.timedelta | None = None, + name: Hashable = None, + closed: IntervalClosedType = "right", ) -> IntervalIndex[Interval[pd.Timedelta]]: ... diff --git a/pandas-stubs/io/parsers/readers.pyi b/pandas-stubs/io/parsers/readers.pyi index 1584c76ab..94ecb529c 100644 --- a/pandas-stubs/io/parsers/readers.pyi +++ b/pandas-stubs/io/parsers/readers.pyi @@ -39,30 +39,30 @@ def read_csv( filepath_or_buffer: FilePath | ReadCsvBuffer[bytes] | ReadCsvBuffer[str], *, sep: str | None = ..., - delimiter: str | None = ..., - header: int | Sequence[int] | Literal["infer"] | None = ..., + delimiter: str | None = None, + header: int | Sequence[int] | Literal["infer"] | None = "infer", names: ListLikeHashable | None = ..., - index_col: int | str | Sequence[str | int] | Literal[False] | None = ..., - usecols: UsecolsArgType[HashableT] = ..., - dtype: DtypeArg | defaultdict | None = ..., - engine: CSVEngine | None = ..., + index_col: int | str | Sequence[str | int] | Literal[False] | None = None, + usecols: UsecolsArgType[HashableT] = None, + dtype: DtypeArg | defaultdict | None = None, + engine: CSVEngine | None = None, converters: ( Mapping[int | str, Callable[[str], Any]] | Mapping[int, Callable[[str], Any]] | Mapping[str, Callable[[str], Any]] | None - ) = ..., - true_values: list[str] | None = ..., - false_values: list[str] | None = ..., - skipinitialspace: bool = ..., - skiprows: int | Sequence[int] | Callable[[int], bool] | None = ..., - skipfooter: int = ..., - nrows: int | None = ..., - na_values: Sequence[str] | Mapping[str, Sequence[str]] | None = ..., - keep_default_na: bool = ..., - na_filter: bool = ..., + ) = None, + true_values: list[str] | None = None, + false_values: list[str] | None = None, + skipinitialspace: bool = False, + skiprows: int | Sequence[int] | Callable[[int], bool] | None = None, + skipfooter: int = 0, + nrows: int | None = None, + na_values: Sequence[str] | Mapping[str, Sequence[str]] | None = None, + keep_default_na: bool = True, + na_filter: bool = True, verbose: bool = ..., - skip_blank_lines: bool = ..., + skip_blank_lines: bool = True, parse_dates: ( bool | list[int] @@ -70,33 +70,33 @@ def read_csv( | Sequence[Sequence[int]] | Mapping[str, Sequence[int | str]] | None - ) = ..., - keep_date_col: bool = ..., - date_format: dict[Hashable, str] | str | None = ..., - dayfirst: bool = ..., - cache_dates: bool = ..., + ) = None, + keep_date_col: bool = True, + date_format: dict[Hashable, str] | str | None = None, + dayfirst: bool = False, + cache_dates: bool = True, iterator: Literal[True], - chunksize: int | None = ..., - compression: CompressionOptions = ..., - thousands: str | None = ..., - decimal: str = ..., - lineterminator: str | None = ..., - quotechar: str = ..., - quoting: CSVQuoting = ..., - doublequote: bool = ..., - escapechar: str | None = ..., - comment: str | None = ..., - encoding: str | None = ..., - encoding_errors: str | None = ..., - dialect: str | csv.Dialect | None = ..., + chunksize: int | None = None, + compression: CompressionOptions = "infer", + thousands: str | None = None, + decimal: str = ".", + lineterminator: str | None = None, + quotechar: str = '"', + quoting: CSVQuoting = 0, + doublequote: bool = True, + escapechar: str | None = None, + comment: str | None = None, + encoding: str | None = None, + encoding_errors: str | None = "strict", + dialect: str | csv.Dialect | None = None, on_bad_lines: ( Literal["error", "warn", "skip"] | Callable[[list[str]], list[str] | None] - ) = ..., + ) = "error", delim_whitespace: bool = ..., low_memory: bool = ..., - memory_map: bool = ..., - float_precision: Literal["high", "legacy", "round_trip"] | None = ..., - storage_options: StorageOptions | None = ..., + memory_map: bool = False, + float_precision: Literal["high", "legacy", "round_trip"] | None = None, + storage_options: StorageOptions | None = None, dtype_backend: DtypeBackend | _NoDefaultDoNotUse = ..., ) -> TextFileReader: ... @overload @@ -104,30 +104,30 @@ def read_csv( filepath_or_buffer: FilePath | ReadCsvBuffer[bytes] | ReadCsvBuffer[str], *, sep: str | None = ..., - delimiter: str | None = ..., - header: int | Sequence[int] | Literal["infer"] | None = ..., + delimiter: str | None = None, + header: int | Sequence[int] | Literal["infer"] | None = "infer", names: ListLikeHashable | None = ..., - index_col: int | str | Sequence[str | int] | Literal[False] | None = ..., - usecols: UsecolsArgType[HashableT] = ..., - dtype: DtypeArg | defaultdict | None = ..., - engine: CSVEngine | None = ..., + index_col: int | str | Sequence[str | int] | Literal[False] | None = None, + usecols: UsecolsArgType[HashableT] = None, + dtype: DtypeArg | defaultdict | None = None, + engine: CSVEngine | None = None, converters: ( Mapping[int | str, Callable[[str], Any]] | Mapping[int, Callable[[str], Any]] | Mapping[str, Callable[[str], Any]] | None - ) = ..., - true_values: list[str] | None = ..., - false_values: list[str] | None = ..., - skipinitialspace: bool = ..., - skiprows: int | Sequence[int] | Callable[[int], bool] | None = ..., - skipfooter: int = ..., - nrows: int | None = ..., - na_values: Sequence[str] | Mapping[str, Sequence[str]] | None = ..., - keep_default_na: bool = ..., - na_filter: bool = ..., + ) = None, + true_values: list[str] | None = None, + false_values: list[str] | None = None, + skipinitialspace: bool = False, + skiprows: int | Sequence[int] | Callable[[int], bool] | None = None, + skipfooter: int = 0, + nrows: int | None = None, + na_values: Sequence[str] | Mapping[str, Sequence[str]] | None = None, + keep_default_na: bool = True, + na_filter: bool = True, verbose: bool = ..., - skip_blank_lines: bool = ..., + skip_blank_lines: bool = True, parse_dates: ( bool | list[int] @@ -135,33 +135,33 @@ def read_csv( | Sequence[Sequence[int]] | Mapping[str, Sequence[int | str]] | None - ) = ..., + ) = None, keep_date_col: bool = ..., - date_format: dict[Hashable, str] | str | None = ..., - dayfirst: bool = ..., - cache_dates: bool = ..., - iterator: bool = ..., + date_format: dict[Hashable, str] | str | None = None, + dayfirst: bool = False, + cache_dates: bool = True, + iterator: bool = False, chunksize: int, - compression: CompressionOptions = ..., - thousands: str | None = ..., - decimal: str = ..., - lineterminator: str | None = ..., - quotechar: str = ..., - quoting: CSVQuoting = ..., - doublequote: bool = ..., - escapechar: str | None = ..., - comment: str | None = ..., - encoding: str | None = ..., - encoding_errors: str | None = ..., - dialect: str | csv.Dialect | None = ..., + compression: CompressionOptions = "infer", + thousands: str | None = None, + decimal: str = ".", + lineterminator: str | None = None, + quotechar: str = '"', + quoting: CSVQuoting = 0, + doublequote: bool = True, + escapechar: str | None = None, + comment: str | None = None, + encoding: str | None = None, + encoding_errors: str | None = "strict", + dialect: str | csv.Dialect | None = None, on_bad_lines: ( Literal["error", "warn", "skip"] | Callable[[list[str]], list[str] | None] - ) = ..., + ) = "error", delim_whitespace: bool = ..., low_memory: bool = ..., - memory_map: bool = ..., - float_precision: Literal["high", "legacy", "round_trip"] | None = ..., - storage_options: StorageOptions | None = ..., + memory_map: bool = False, + float_precision: Literal["high", "legacy", "round_trip"] | None = None, + storage_options: StorageOptions | None = None, dtype_backend: DtypeBackend | _NoDefaultDoNotUse = ..., ) -> TextFileReader: ... @overload @@ -234,30 +234,30 @@ def read_table( filepath_or_buffer: FilePath | ReadCsvBuffer[bytes] | ReadCsvBuffer[str], *, sep: str | None = ..., - delimiter: str | None = ..., - header: int | Sequence[int] | Literal["infer"] | None = ..., + delimiter: str | None = None, + header: int | Sequence[int] | Literal["infer"] | None = "infer", names: ListLikeHashable | None = ..., - index_col: int | str | Sequence[str | int] | Literal[False] | None = ..., - usecols: UsecolsArgType[HashableT] = ..., - dtype: DtypeArg | defaultdict | None = ..., - engine: CSVEngine | None = ..., + index_col: int | str | Sequence[str | int] | Literal[False] | None = None, + usecols: UsecolsArgType[HashableT] = None, + dtype: DtypeArg | defaultdict | None = None, + engine: CSVEngine | None = None, converters: ( Mapping[int | str, Callable[[str], Any]] | Mapping[int, Callable[[str], Any]] | Mapping[str, Callable[[str], Any]] | None - ) = ..., - true_values: list[str] | None = ..., - false_values: list[str] | None = ..., - skipinitialspace: bool = ..., - skiprows: int | Sequence[int] | Callable[[int], bool] | None = ..., - skipfooter: int = ..., - nrows: int | None = ..., - na_values: Sequence[str] | Mapping[str, Sequence[str]] | None = ..., - keep_default_na: bool = ..., - na_filter: bool = ..., + ) = None, + true_values: list[str] | None = None, + false_values: list[str] | None = None, + skipinitialspace: bool = False, + skiprows: int | Sequence[int] | Callable[[int], bool] | None = None, + skipfooter: int = 0, + nrows: int | None = None, + na_values: Sequence[str] | Mapping[str, Sequence[str]] | None = None, + keep_default_na: bool = True, + na_filter: bool = True, verbose: bool = ..., - skip_blank_lines: bool = ..., + skip_blank_lines: bool = True, parse_dates: ( bool | list[int] @@ -265,64 +265,64 @@ def read_table( | Sequence[Sequence[int]] | Mapping[str, Sequence[int | str]] | None - ) = ..., + ) = False, infer_datetime_format: bool = ..., keep_date_col: bool = ..., - date_format: dict[Hashable, str] | str | None = ..., - dayfirst: bool = ..., - cache_dates: bool = ..., + date_format: dict[Hashable, str] | str | None = None, + dayfirst: bool = False, + cache_dates: bool = True, iterator: Literal[True], - chunksize: int | None = ..., - compression: CompressionOptions = ..., - thousands: str | None = ..., - decimal: str = ..., - lineterminator: str | None = ..., - quotechar: str = ..., - quoting: CSVQuoting = ..., - doublequote: bool = ..., - escapechar: str | None = ..., - comment: str | None = ..., - encoding: str | None = ..., - encoding_errors: str | None = ..., - dialect: str | csv.Dialect | None = ..., + chunksize: int | None = None, + compression: CompressionOptions = "infer", + thousands: str | None = None, + decimal: str = ".", + lineterminator: str | None = None, + quotechar: str = '"', + quoting: CSVQuoting = 0, + doublequote: bool = True, + escapechar: str | None = None, + comment: str | None = None, + encoding: str | None = None, + encoding_errors: str | None = "strict", + dialect: str | csv.Dialect | None = None, on_bad_lines: ( Literal["error", "warn", "skip"] | Callable[[list[str]], list[str] | None] - ) = ..., + ) = "error", delim_whitespace: bool = ..., low_memory: bool = ..., - memory_map: bool = ..., - float_precision: Literal["high", "legacy", "round_trip"] | None = ..., - storage_options: StorageOptions | None = ..., + memory_map: bool = False, + float_precision: Literal["high", "legacy", "round_trip"] | None = None, + storage_options: StorageOptions | None = None, ) -> TextFileReader: ... @overload def read_table( filepath_or_buffer: FilePath | ReadCsvBuffer[bytes] | ReadCsvBuffer[str], *, sep: str | None = ..., - delimiter: str | None = ..., - header: int | Sequence[int] | Literal["infer"] | None = ..., + delimiter: str | None = None, + header: int | Sequence[int] | Literal["infer"] | None = "infer", names: ListLikeHashable | None = ..., - index_col: int | str | Sequence[str | int] | Literal[False] | None = ..., - usecols: UsecolsArgType[HashableT] = ..., - dtype: DtypeArg | defaultdict | None = ..., - engine: CSVEngine | None = ..., + index_col: int | str | Sequence[str | int] | Literal[False] | None = None, + usecols: UsecolsArgType[HashableT] = None, + dtype: DtypeArg | defaultdict | None = None, + engine: CSVEngine | None = None, converters: ( Mapping[int | str, Callable[[str], Any]] | Mapping[int, Callable[[str], Any]] | Mapping[str, Callable[[str], Any]] | None - ) = ..., - true_values: list[str] | None = ..., - false_values: list[str] | None = ..., - skipinitialspace: bool = ..., - skiprows: int | Sequence[int] | Callable[[int], bool] | None = ..., - skipfooter: int = ..., - nrows: int | None = ..., - na_values: Sequence[str] | Mapping[str, Sequence[str]] | None = ..., - keep_default_na: bool = ..., - na_filter: bool = ..., + ) = None, + true_values: list[str] | None = None, + false_values: list[str] | None = None, + skipinitialspace: bool = False, + skiprows: int | Sequence[int] | Callable[[int], bool] | None = None, + skipfooter: int = 0, + nrows: int | None = None, + na_values: Sequence[str] | Mapping[str, Sequence[str]] | None = None, + keep_default_na: bool = True, + na_filter: bool = True, verbose: bool = ..., - skip_blank_lines: bool = ..., + skip_blank_lines: bool = True, parse_dates: ( bool | list[int] @@ -330,64 +330,64 @@ def read_table( | Sequence[Sequence[int]] | Mapping[str, Sequence[int | str]] | None - ) = ..., + ) = False, infer_datetime_format: bool = ..., keep_date_col: bool = ..., - date_format: dict[Hashable, str] | str | None = ..., - dayfirst: bool = ..., - cache_dates: bool = ..., - iterator: bool = ..., + date_format: dict[Hashable, str] | str | None = None, + dayfirst: bool = False, + cache_dates: bool = True, + iterator: bool = False, chunksize: int, - compression: CompressionOptions = ..., - thousands: str | None = ..., - decimal: str = ..., - lineterminator: str | None = ..., - quotechar: str = ..., - quoting: CSVQuoting = ..., - doublequote: bool = ..., - escapechar: str | None = ..., - comment: str | None = ..., - encoding: str | None = ..., - encoding_errors: str | None = ..., - dialect: str | csv.Dialect | None = ..., + compression: CompressionOptions = "infer", + thousands: str | None = None, + decimal: str = ".", + lineterminator: str | None = None, + quotechar: str = '"', + quoting: CSVQuoting = 0, + doublequote: bool = True, + escapechar: str | None = None, + comment: str | None = None, + encoding: str | None = None, + encoding_errors: str | None = "strict", + dialect: str | csv.Dialect | None = None, on_bad_lines: ( Literal["error", "warn", "skip"] | Callable[[list[str]], list[str] | None] - ) = ..., + ) = "error", delim_whitespace: bool = ..., low_memory: bool = ..., - memory_map: bool = ..., - float_precision: Literal["high", "legacy", "round_trip"] | None = ..., - storage_options: StorageOptions | None = ..., + memory_map: bool = False, + float_precision: Literal["high", "legacy", "round_trip"] | None = None, + storage_options: StorageOptions | None = None, ) -> TextFileReader: ... @overload def read_table( filepath_or_buffer: FilePath | ReadCsvBuffer[bytes] | ReadCsvBuffer[str], *, sep: str | None = ..., - delimiter: str | None = ..., - header: int | Sequence[int] | Literal["infer"] | None = ..., + delimiter: str | None = None, + header: int | Sequence[int] | Literal["infer"] | None = "infer", names: ListLikeHashable | None = ..., - index_col: int | str | Sequence[str | int] | Literal[False] | None = ..., - usecols: UsecolsArgType[HashableT] = ..., - dtype: DtypeArg | defaultdict | None = ..., - engine: CSVEngine | None = ..., + index_col: int | str | Sequence[str | int] | Literal[False] | None = None, + usecols: UsecolsArgType[HashableT] = None, + dtype: DtypeArg | defaultdict | None = None, + engine: CSVEngine | None = None, converters: ( Mapping[int | str, Callable[[str], Any]] | Mapping[int, Callable[[str], Any]] | Mapping[str, Callable[[str], Any]] | None - ) = ..., - true_values: list[str] | None = ..., - false_values: list[str] | None = ..., - skipinitialspace: bool = ..., - skiprows: int | Sequence[int] | Callable[[int], bool] | None = ..., - skipfooter: int = ..., - nrows: int | None = ..., - na_values: Sequence[str] | Mapping[str, Sequence[str]] | None = ..., - keep_default_na: bool = ..., - na_filter: bool = ..., + ) = None, + true_values: list[str] | None = None, + false_values: list[str] | None = None, + skipinitialspace: bool = False, + skiprows: int | Sequence[int] | Callable[[int], bool] | None = None, + skipfooter: int = 0, + nrows: int | None = None, + na_values: Sequence[str] | Mapping[str, Sequence[str]] | None = None, + keep_default_na: bool = True, + na_filter: bool = True, verbose: bool = ..., - skip_blank_lines: bool = ..., + skip_blank_lines: bool = True, parse_dates: ( bool | list[int] @@ -395,34 +395,34 @@ def read_table( | Sequence[Sequence[int]] | Mapping[str, Sequence[int | str]] | None - ) = ..., + ) = False, infer_datetime_format: bool = ..., keep_date_col: bool = ..., - date_format: dict[Hashable, str] | str | None = ..., - dayfirst: bool = ..., - cache_dates: bool = ..., + date_format: dict[Hashable, str] | str | None = None, + dayfirst: bool = False, + cache_dates: bool = True, iterator: Literal[False] = False, chunksize: None = None, - compression: CompressionOptions = ..., - thousands: str | None = ..., - decimal: str = ..., - lineterminator: str | None = ..., - quotechar: str = ..., - quoting: CSVQuoting = ..., - doublequote: bool = ..., - escapechar: str | None = ..., - comment: str | None = ..., - encoding: str | None = ..., - encoding_errors: str | None = ..., - dialect: str | csv.Dialect | None = ..., + compression: CompressionOptions = "infer", + thousands: str | None = None, + decimal: str = ".", + lineterminator: str | None = None, + quotechar: str = '"', + quoting: CSVQuoting = 0, + doublequote: bool = True, + escapechar: str | None = None, + comment: str | None = None, + encoding: str | None = None, + encoding_errors: str | None = "strict", + dialect: str | csv.Dialect | None = None, on_bad_lines: ( Literal["error", "warn", "skip"] | Callable[[list[str]], list[str] | None] - ) = ..., + ) = "error", delim_whitespace: bool = ..., low_memory: bool = ..., - memory_map: bool = ..., - float_precision: Literal["high", "legacy", "round_trip"] | None = ..., - storage_options: StorageOptions | None = ..., + memory_map: bool = False, + float_precision: Literal["high", "legacy", "round_trip"] | None = None, + storage_options: StorageOptions | None = None, ) -> DataFrame: ... @overload def read_fwf( diff --git a/pandas-stubs/io/sql.pyi b/pandas-stubs/io/sql.pyi index b1dfd7b63..428f3a503 100644 --- a/pandas-stubs/io/sql.pyi +++ b/pandas-stubs/io/sql.pyi @@ -105,8 +105,8 @@ def read_sql_query( def read_sql( sql: _SQLStatement, con: _SQLConnection, - index_col: str | list[str] | None = ..., - coerce_float: bool = ..., + index_col: str | list[str] | None = None, + coerce_float: bool = True, params: ( list[Scalar] | tuple[Scalar, ...] @@ -115,8 +115,8 @@ def read_sql( | Mapping[str, tuple[Scalar, ...]] | None ) = ..., - parse_dates: list[str] | dict[str, str] | dict[str, dict[str, Any]] | None = ..., - columns: list[str] | None = ..., + parse_dates: list[str] | dict[str, str] | dict[str, dict[str, Any]] | None = None, + columns: list[str] | None = None, *, chunksize: int, dtype: DtypeArg | None = ..., @@ -126,8 +126,8 @@ def read_sql( def read_sql( sql: _SQLStatement, con: _SQLConnection, - index_col: str | list[str] | None = ..., - coerce_float: bool = ..., + index_col: str | list[str] | None = None, + coerce_float: bool = True, params: ( list[Scalar] | tuple[Scalar, ...] @@ -136,10 +136,10 @@ def read_sql( | Mapping[str, tuple[Scalar, ...]] | None ) = ..., - parse_dates: list[str] | dict[str, str] | dict[str, dict[str, Any]] | None = ..., - columns: list[str] | None = ..., + parse_dates: list[str] | dict[str, str] | dict[str, dict[str, Any]] | None = None, + columns: list[str] | None = None, chunksize: None = None, - dtype: DtypeArg | None = ..., + dtype: DtypeArg | None = None, dtype_backend: DtypeBackend | _NoDefaultDoNotUse = ..., ) -> DataFrame: ...