Skip to content

⬆️ UPGRADE: Autoupdate pre-commit config #54043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.270
rev: v0.0.275
hooks:
- id: ruff
args: [--exit-non-zero-on-fix]
Expand All @@ -33,7 +33,7 @@ repos:
pass_filenames: true
require_serial: false
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
rev: v2.2.5
hooks:
- id: codespell
types_or: [python, rst, markdown, cython, c]
Expand Down Expand Up @@ -91,7 +91,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
rev: v3.4.0
rev: v3.7.0
hooks:
- id: pyupgrade
args: [--py39-plus]
Expand Down
8 changes: 0 additions & 8 deletions pandas/_libs/algos.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ import numpy as np
from pandas._typing import npt

class Infinity:
"""
Provide a positive Infinity comparison method for ranking.
"""

def __eq__(self, other) -> bool: ...
def __ne__(self, other) -> bool: ...
def __lt__(self, other) -> bool: ...
Expand All @@ -17,10 +13,6 @@ class Infinity:
def __ge__(self, other) -> bool: ...

class NegInfinity:
"""
Provide a negative Infinity comparison method for ranking.
"""

def __eq__(self, other) -> bool: ...
def __ne__(self, other) -> bool: ...
def __lt__(self, other) -> bool: ...
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ def searchsorted(
arr: ArrayLike,
value: NumpyValueArrayLike | ExtensionArray,
side: Literal["left", "right"] = "left",
sorter: NumpySorter = None,
sorter: NumpySorter | None = None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

niice

) -> npt.NDArray[np.intp] | np.intp:
"""
Find indices where elements should be inserted to maintain order.
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def searchsorted(
self,
value: NumpyValueArrayLike | ExtensionArray,
side: Literal["left", "right"] = "left",
sorter: NumpySorter = None,
sorter: NumpySorter | None = None,
) -> npt.NDArray[np.intp] | np.intp:
npvalue = self._validate_setitem_value(value)
return self._ndarray.searchsorted(npvalue, side=side, sorter=sorter)
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/arrow/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ def searchsorted(
self,
value: NumpyValueArrayLike | ExtensionArray,
side: Literal["left", "right"] = "left",
sorter: NumpySorter = None,
sorter: NumpySorter | None = None,
) -> npt.NDArray[np.intp] | np.intp:
if self._hasna:
raise ValueError(
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ def searchsorted(
self,
value: NumpyValueArrayLike | ExtensionArray,
side: Literal["left", "right"] = "left",
sorter: NumpySorter = None,
sorter: NumpySorter | None = None,
) -> npt.NDArray[np.intp] | np.intp:
"""
Find indices where elements should be inserted to maintain order.
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/masked.py
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ def searchsorted(
self,
value: NumpyValueArrayLike | ExtensionArray,
side: Literal["left", "right"] = "left",
sorter: NumpySorter = None,
sorter: NumpySorter | None = None,
) -> npt.NDArray[np.intp] | np.intp:
if self._hasna:
raise ValueError(
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/period.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ def searchsorted(
self,
value: NumpyValueArrayLike | ExtensionArray,
side: Literal["left", "right"] = "left",
sorter: NumpySorter = None,
sorter: NumpySorter | None = None,
) -> npt.NDArray[np.intp] | np.intp:
npvalue = self._validate_setitem_value(value).view("M8[ns]")

Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/sparse/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,7 @@ def searchsorted(
self,
v: ArrayLike | object,
side: Literal["left", "right"] = "left",
sorter: NumpySorter = None,
sorter: NumpySorter | None = None,
) -> npt.NDArray[np.intp] | np.intp:
msg = "searchsorted requires high memory usage."
warnings.warn(msg, PerformanceWarning, stacklevel=find_stack_level())
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/string_.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def searchsorted(
self,
value: NumpyValueArrayLike | ExtensionArray,
side: Literal["left", "right"] = "left",
sorter: NumpySorter = None,
sorter: NumpySorter | None = None,
) -> npt.NDArray[np.intp] | np.intp:
if self._hasna:
raise ValueError(
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,7 @@ def searchsorted(
self,
value: NumpyValueArrayLike | ExtensionArray,
side: Literal["left", "right"] = "left",
sorter: NumpySorter = None,
sorter: NumpySorter | None = None,
) -> npt.NDArray[np.intp] | np.intp:
if isinstance(value, ABCDataFrame):
msg = (
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/dtypes/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def _from_fastpath(

@classmethod
def _from_categorical_dtype(
cls, dtype: CategoricalDtype, categories=None, ordered: Ordered = None
cls, dtype: CategoricalDtype, categories=None, ordered: Ordered | None = None
) -> CategoricalDtype:
if categories is ordered is None:
return dtype
Expand Down
44 changes: 24 additions & 20 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2563,7 +2563,7 @@ def to_stata(
version: int | None = 114,
convert_strl: Sequence[Hashable] | None = None,
compression: CompressionOptions = "infer",
storage_options: StorageOptions = None,
storage_options: StorageOptions | None = None,
value_labels: dict[Hashable, dict[float, str]] | None = None,
) -> None:
"""
Expand Down Expand Up @@ -2758,7 +2758,7 @@ def to_markdown(
buf: FilePath | WriteBuffer[str] | None = None,
mode: str = "wt",
index: bool = True,
storage_options: StorageOptions = None,
storage_options: StorageOptions | None = None,
**kwargs,
) -> str | None:
if "showindex" in kwargs:
Expand Down Expand Up @@ -2810,7 +2810,7 @@ def to_parquet(
compression: str | None = "snappy",
index: bool | None = None,
partition_cols: list[str] | None = None,
storage_options: StorageOptions = None,
storage_options: StorageOptions | None = None,
**kwargs,
) -> bytes | None:
"""
Expand Down Expand Up @@ -3179,7 +3179,7 @@ def to_xml(
parser: XMLParsers | None = "lxml",
stylesheet: FilePath | ReadBuffer[str] | ReadBuffer[bytes] | None = None,
compression: CompressionOptions = "infer",
storage_options: StorageOptions = None,
storage_options: StorageOptions | None = None,
) -> str | None:
"""
Render a DataFrame to an XML document.
Expand Down Expand Up @@ -5080,12 +5080,12 @@ def drop(

def drop(
self,
labels: IndexLabel = None,
labels: IndexLabel | None = None,
*,
axis: Axis = 0,
index: IndexLabel = None,
columns: IndexLabel = None,
level: Level = None,
index: IndexLabel | None = None,
columns: IndexLabel | None = None,
level: Level | None = None,
inplace: bool = False,
errors: IgnoreRaise = "raise",
) -> DataFrame | None:
Expand Down Expand Up @@ -5290,7 +5290,7 @@ def rename(
axis: Axis | None = None,
copy: bool | None = None,
inplace: bool = False,
level: Level = None,
level: Level | None = None,
errors: IgnoreRaise = "ignore",
) -> DataFrame | None:
"""
Expand Down Expand Up @@ -5805,7 +5805,7 @@ def reset_index(
col_level: Hashable = ...,
col_fill: Hashable = ...,
allow_duplicates: bool | lib.NoDefault = ...,
names: Hashable | Sequence[Hashable] = None,
names: Hashable | Sequence[Hashable] | None = None,
) -> DataFrame:
...

Expand All @@ -5819,7 +5819,7 @@ def reset_index(
col_level: Hashable = ...,
col_fill: Hashable = ...,
allow_duplicates: bool | lib.NoDefault = ...,
names: Hashable | Sequence[Hashable] = None,
names: Hashable | Sequence[Hashable] | None = None,
) -> None:
...

Expand All @@ -5833,20 +5833,20 @@ def reset_index(
col_level: Hashable = ...,
col_fill: Hashable = ...,
allow_duplicates: bool | lib.NoDefault = ...,
names: Hashable | Sequence[Hashable] = None,
names: Hashable | Sequence[Hashable] | None = None,
) -> DataFrame | None:
...

def reset_index(
self,
level: IndexLabel = None,
level: IndexLabel | None = None,
*,
drop: bool = False,
inplace: bool = False,
col_level: Hashable = 0,
col_fill: Hashable = "",
allow_duplicates: bool | lib.NoDefault = lib.no_default,
names: Hashable | Sequence[Hashable] = None,
names: Hashable | Sequence[Hashable] | None = None,
) -> DataFrame | None:
"""
Reset the index, or a level of it.
Expand Down Expand Up @@ -6142,7 +6142,7 @@ def dropna(
axis: Axis = 0,
how: AnyAll | lib.NoDefault = lib.no_default,
thresh: int | lib.NoDefault = lib.no_default,
subset: IndexLabel = None,
subset: IndexLabel | None = None,
inplace: bool = False,
ignore_index: bool = False,
) -> DataFrame | None:
Expand Down Expand Up @@ -6579,7 +6579,7 @@ def sort_values(
kind: SortKind = "quicksort",
na_position: str = "last",
ignore_index: bool = False,
key: ValueKeyFunc = None,
key: ValueKeyFunc | None = None,
) -> DataFrame | None:
"""
Sort by the values along either axis.
Expand Down Expand Up @@ -6858,14 +6858,14 @@ def sort_index(
self,
*,
axis: Axis = 0,
level: IndexLabel = None,
level: IndexLabel | None = None,
ascending: bool | Sequence[bool] = True,
inplace: bool = False,
kind: SortKind = "quicksort",
na_position: NaPosition = "last",
sort_remaining: bool = True,
ignore_index: bool = False,
key: IndexKeyFunc = None,
key: IndexKeyFunc | None = None,
) -> DataFrame | None:
"""
Sort object by labels (along an axis).
Expand Down Expand Up @@ -7633,7 +7633,11 @@ def _should_reindex_frame_op(self, right, op, axis: int, fill_value, level) -> b
return False

def _align_for_op(
self, other, axis: AxisInt, flex: bool | None = False, level: Level = None
self,
other,
axis: AxisInt,
flex: bool | None = False,
level: Level | None = None,
):
"""
Convert rhs to meet lhs dims if input is list, tuple or np.ndarray.
Expand Down Expand Up @@ -9387,7 +9391,7 @@ def melt(
value_vars=None,
var_name=None,
value_name: Hashable = "value",
col_level: Level = None,
col_level: Level | None = None,
ignore_index: bool = True,
) -> DataFrame:
return melt(
Expand Down
Loading