Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#60470)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.7.2 → v0.8.1](astral-sh/ruff-pre-commit@v0.7.2...v0.8.1)
- [github.com/MarcoGorelli/cython-lint: v0.16.2 → v0.16.6](MarcoGorelli/cython-lint@v0.16.2...v0.16.6)
- [github.com/pre-commit/mirrors-clang-format: v19.1.3 → v19.1.4](pre-commit/mirrors-clang-format@v19.1.3...v19.1.4)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Apply ruff changes

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Matthew Roeschke <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and mroeschke authored Dec 3, 2024
1 parent a14a8be commit 40131a6
Show file tree
Hide file tree
Showing 66 changed files with 276 additions and 307 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ci:
skip: [pyright, mypy]
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.2
rev: v0.8.1
hooks:
- id: ruff
args: [--exit-non-zero-on-fix]
Expand Down Expand Up @@ -47,7 +47,7 @@ repos:
types_or: [python, rst, markdown, cython, c]
additional_dependencies: [tomli]
- repo: https://github.com/MarcoGorelli/cython-lint
rev: v0.16.2
rev: v0.16.6
hooks:
- id: cython-lint
- id: double-quote-cython-strings
Expand Down Expand Up @@ -95,7 +95,7 @@ repos:
- id: sphinx-lint
args: ["--enable", "all", "--disable", "line-too-long"]
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.3
rev: v19.1.4
hooks:
- id: clang-format
files: ^pandas/_libs/src|^pandas/_libs/include
Expand Down
3 changes: 1 addition & 2 deletions asv_bench/benchmarks/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,7 @@ def setup(self, dtype, method, application, ncols, engine):
# grouping on multiple columns
# and we lack kernels for a bunch of methods
if (
engine == "numba"
and method in _numba_unsupported_methods
(engine == "numba" and method in _numba_unsupported_methods)
or ncols > 1
or application == "transformation"
or dtype == "datetime"
Expand Down
8 changes: 4 additions & 4 deletions pandas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@
# Pandas is not (yet) a py.typed library: the public API is determined
# based on the documentation.
__all__ = [
"NA",
"ArrowDtype",
"BooleanDtype",
"Categorical",
Expand All @@ -253,15 +254,14 @@
"HDFStore",
"Index",
"IndexSlice",
"Int8Dtype",
"Int16Dtype",
"Int32Dtype",
"Int64Dtype",
"Int8Dtype",
"Interval",
"IntervalDtype",
"IntervalIndex",
"MultiIndex",
"NA",
"NaT",
"NamedAgg",
"Period",
Expand All @@ -274,10 +274,10 @@
"Timedelta",
"TimedeltaIndex",
"Timestamp",
"UInt8Dtype",
"UInt16Dtype",
"UInt32Dtype",
"UInt64Dtype",
"UInt8Dtype",
"api",
"array",
"arrays",
Expand All @@ -290,8 +290,8 @@
"errors",
"eval",
"factorize",
"get_dummies",
"from_dummies",
"get_dummies",
"get_option",
"infer_freq",
"interval_range",
Expand Down
6 changes: 3 additions & 3 deletions pandas/_config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

__all__ = [
"config",
"describe_option",
"detect_console_encoding",
"get_option",
"set_option",
"reset_option",
"describe_option",
"option_context",
"options",
"reset_option",
"set_option",
]
from pandas._config import config
from pandas._config import dates # pyright: ignore[reportUnusedImport] # noqa: F401
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
__all__ = [
"Interval",
"NaT",
"NaTType",
"OutOfBoundsDatetime",
"Period",
"Timedelta",
"Timestamp",
"iNaT",
"Interval",
]


Expand Down
44 changes: 22 additions & 22 deletions pandas/_libs/tslibs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
__all__ = [
"dtypes",
"localize_pydatetime",
"BaseOffset",
"IncompatibleFrequency",
"NaT",
"NaTType",
"iNaT",
"nat_strings",
"OutOfBoundsDatetime",
"OutOfBoundsTimedelta",
"IncompatibleFrequency",
"Period",
"Resolution",
"Tick",
"Timedelta",
"normalize_i8_timestamps",
"is_date_array_normalized",
"dt64arr_to_periodarr",
"Timestamp",
"add_overflowsafe",
"astype_overflowsafe",
"delta_to_nanoseconds",
"dt64arr_to_periodarr",
"dtypes",
"get_resolution",
"get_supported_dtype",
"get_unit_from_dtype",
"guess_datetime_format",
"iNaT",
"ints_to_pydatetime",
"ints_to_pytimedelta",
"get_resolution",
"Timestamp",
"tz_convert_from_utc_single",
"tz_convert_from_utc",
"to_offset",
"Tick",
"BaseOffset",
"tz_compare",
"is_date_array_normalized",
"is_supported_dtype",
"is_unitless",
"astype_overflowsafe",
"get_unit_from_dtype",
"localize_pydatetime",
"nat_strings",
"normalize_i8_timestamps",
"periods_per_day",
"periods_per_second",
"guess_datetime_format",
"add_overflowsafe",
"get_supported_dtype",
"is_supported_dtype",
"to_offset",
"tz_compare",
"tz_convert_from_utc",
"tz_convert_from_utc_single",
]

from pandas._libs.tslibs import dtypes
Expand Down
44 changes: 22 additions & 22 deletions pandas/_testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,25 @@ def shares_memory(left, right) -> bool:
"ALL_INT_NUMPY_DTYPES",
"ALL_NUMPY_DTYPES",
"ALL_REAL_NUMPY_DTYPES",
"BOOL_DTYPES",
"BYTES_DTYPES",
"COMPLEX_DTYPES",
"DATETIME64_DTYPES",
"ENDIAN",
"FLOAT_EA_DTYPES",
"FLOAT_NUMPY_DTYPES",
"NARROW_NP_DTYPES",
"NP_NAT_OBJECTS",
"NULL_OBJECTS",
"OBJECT_DTYPES",
"SIGNED_INT_EA_DTYPES",
"SIGNED_INT_NUMPY_DTYPES",
"STRING_DTYPES",
"TIMEDELTA64_DTYPES",
"UNSIGNED_INT_EA_DTYPES",
"UNSIGNED_INT_NUMPY_DTYPES",
"SubclassedDataFrame",
"SubclassedSeries",
"assert_almost_equal",
"assert_attr_equal",
"assert_categorical_equal",
Expand All @@ -563,51 +582,32 @@ def shares_memory(left, right) -> bool:
"assert_sp_array_equal",
"assert_timedelta_array_equal",
"at",
"BOOL_DTYPES",
"box_expected",
"BYTES_DTYPES",
"can_set_locale",
"COMPLEX_DTYPES",
"convert_rows_list_to_csv_str",
"DATETIME64_DTYPES",
"decompress_file",
"ENDIAN",
"ensure_clean",
"external_error_raised",
"FLOAT_EA_DTYPES",
"FLOAT_NUMPY_DTYPES",
"get_cython_table_params",
"get_dtype",
"getitem",
"get_locales",
"get_finest_unit",
"get_locales",
"get_obj",
"get_op_from_name",
"getitem",
"iat",
"iloc",
"loc",
"maybe_produces_warning",
"NARROW_NP_DTYPES",
"NP_NAT_OBJECTS",
"NULL_OBJECTS",
"OBJECT_DTYPES",
"raise_assert_detail",
"raises_chained_assignment_error",
"round_trip_pathlib",
"round_trip_pickle",
"setitem",
"set_locale",
"set_timezone",
"setitem",
"shares_memory",
"SIGNED_INT_EA_DTYPES",
"SIGNED_INT_NUMPY_DTYPES",
"STRING_DTYPES",
"SubclassedDataFrame",
"SubclassedSeries",
"TIMEDELTA64_DTYPES",
"to_array",
"UNSIGNED_INT_EA_DTYPES",
"UNSIGNED_INT_NUMPY_DTYPES",
"with_csv_dialect",
"write_to_compressed",
]
14 changes: 4 additions & 10 deletions pandas/_testing/asserters.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,11 +755,8 @@ def assert_extension_array_equal(
and atol is lib.no_default
):
check_exact = (
is_numeric_dtype(left.dtype)
and not is_float_dtype(left.dtype)
or is_numeric_dtype(right.dtype)
and not is_float_dtype(right.dtype)
)
is_numeric_dtype(left.dtype) and not is_float_dtype(left.dtype)
) or (is_numeric_dtype(right.dtype) and not is_float_dtype(right.dtype))
elif check_exact is lib.no_default:
check_exact = False

Expand Down Expand Up @@ -944,11 +941,8 @@ def assert_series_equal(
and atol is lib.no_default
):
check_exact = (
is_numeric_dtype(left.dtype)
and not is_float_dtype(left.dtype)
or is_numeric_dtype(right.dtype)
and not is_float_dtype(right.dtype)
)
is_numeric_dtype(left.dtype) and not is_float_dtype(left.dtype)
) or (is_numeric_dtype(right.dtype) and not is_float_dtype(right.dtype))
left_index_dtypes = (
[left.index.dtype] if left.index.nlevels == 1 else left.index.dtypes
)
Expand Down
6 changes: 3 additions & 3 deletions pandas/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def mode(self) -> str:
# for _get_filepath_or_buffer
...

def seek(self, __offset: int, __whence: int = ...) -> int:
def seek(self, offset: int, whence: int = ..., /) -> int:
# with one argument: gzip.GzipFile, bz2.BZ2File
# with two arguments: zip.ZipFile, read_sas
...
Expand All @@ -288,13 +288,13 @@ def tell(self) -> int:


class ReadBuffer(BaseBuffer, Protocol[AnyStr_co]):
def read(self, __n: int = ...) -> AnyStr_co:
def read(self, n: int = ..., /) -> AnyStr_co:
# for BytesIOWrapper, gzip.GzipFile, bz2.BZ2File
...


class WriteBuffer(BaseBuffer, Protocol[AnyStr_contra]):
def write(self, __b: AnyStr_contra) -> Any:
def write(self, b: AnyStr_contra, /) -> Any:
# for gzip.GzipFile, bz2.BZ2File
...

Expand Down
2 changes: 1 addition & 1 deletion pandas/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
)

__all__ = [
"interchange",
"extensions",
"indexers",
"interchange",
"types",
"typing",
]
8 changes: 4 additions & 4 deletions pandas/api/extensions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
)

__all__ = [
"no_default",
"ExtensionArray",
"ExtensionDtype",
"register_extension_dtype",
"ExtensionScalarOpsMixin",
"no_default",
"register_dataframe_accessor",
"register_extension_dtype",
"register_index_accessor",
"register_series_accessor",
"take",
"ExtensionArray",
"ExtensionScalarOpsMixin",
]
2 changes: 1 addition & 1 deletion pandas/api/indexers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
)

__all__ = [
"check_array_indexer",
"BaseIndexer",
"FixedForwardWindowIndexer",
"VariableOffsetWindowIndexer",
"check_array_indexer",
]
2 changes: 1 addition & 1 deletion pandas/api/interchange/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
from pandas.core.interchange.dataframe_protocol import DataFrame
from pandas.core.interchange.from_dataframe import from_dataframe

__all__ = ["from_dataframe", "DataFrame"]
__all__ = ["DataFrame", "from_dataframe"]
4 changes: 2 additions & 2 deletions pandas/api/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
)

__all__ = [
"infer_dtype",
"union_categoricals",
"CategoricalDtype",
"DatetimeTZDtype",
"IntervalDtype",
"PeriodDtype",
"infer_dtype",
"union_categoricals",
]
8 changes: 3 additions & 5 deletions pandas/api/typing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,16 @@
"ExponentialMovingWindowGroupby",
"FrozenList",
"JsonReader",
"NaTType",
"NAType",
"NaTType",
"PeriodIndexResamplerGroupby",
"Resampler",
"Rolling",
"RollingGroupby",
"SASReader",
"SeriesGroupBy",
"StataReader",
"SASReader",
# See TODO above
# "Styler",
"TimedeltaIndexResamplerGroupby",
"TimeGrouper",
"TimedeltaIndexResamplerGroupby",
"Window",
]
Loading

0 comments on commit 40131a6

Please sign in to comment.