Skip to content

Commit bc79c52

Browse files
[pre-commit.ci] pre-commit autoupdate (#59156)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.4.7 → v0.5.0](astral-sh/ruff-pre-commit@v0.4.7...v0.5.0) - [github.com/asottile/pyupgrade: v3.15.2 → v3.16.0](asottile/pyupgrade@v3.15.2...v3.16.0) - [github.com/pre-commit/mirrors-clang-format: v18.1.5 → v18.1.8](pre-commit/mirrors-clang-format@v18.1.5...v18.1.8) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Ingore E721 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Matthew Roeschke <[email protected]>
1 parent 3782dd1 commit bc79c52

File tree

7 files changed

+11
-9
lines changed

7 files changed

+11
-9
lines changed

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ci:
1919
skip: [pyright, mypy]
2020
repos:
2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: v0.4.7
22+
rev: v0.5.0
2323
hooks:
2424
- id: ruff
2525
args: [--exit-non-zero-on-fix]
@@ -73,7 +73,7 @@ repos:
7373
hooks:
7474
- id: isort
7575
- repo: https://github.com/asottile/pyupgrade
76-
rev: v3.15.2
76+
rev: v3.16.0
7777
hooks:
7878
- id: pyupgrade
7979
args: [--py310-plus]
@@ -93,7 +93,7 @@ repos:
9393
- id: sphinx-lint
9494
args: ["--enable", "all", "--disable", "line-too-long"]
9595
- repo: https://github.com/pre-commit/mirrors-clang-format
96-
rev: v18.1.5
96+
rev: v18.1.8
9797
hooks:
9898
- id: clang-format
9999
files: ^pandas/_libs/src|^pandas/_libs/include

pandas/core/common.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def is_bool_indexer(key: Any) -> bool:
145145
elif isinstance(key, list):
146146
# check if np.array(key).dtype would be bool
147147
if len(key) > 0:
148-
if type(key) is not list: # noqa: E721
148+
if type(key) is not list:
149149
# GH#42461 cython will raise TypeError if we pass a subclass
150150
key = list(key)
151151
return lib.is_bool_list(key)

pandas/core/indexes/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7528,7 +7528,7 @@ def ensure_index(index_like: Axes, copy: bool = False) -> Index:
75287528
index_like = list(index_like)
75297529

75307530
if isinstance(index_like, list):
7531-
if type(index_like) is not list: # noqa: E721
7531+
if type(index_like) is not list:
75327532
# must check for exactly list here because of strict type
75337533
# check in clean_index_list
75347534
index_like = list(index_like)

pandas/core/internals/construction.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ def _list_of_dict_to_arrays(
842842

843843
# assure that they are of the base dict class and not of derived
844844
# classes
845-
data = [d if type(d) is dict else dict(d) for d in data] # noqa: E721
845+
data = [d if type(d) is dict else dict(d) for d in data]
846846

847847
content = lib.dicts_to_array(data, list(columns))
848848
return content, columns

pandas/core/tools/datetimes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class FulldatetimeDict(YearMonthDayDict, total=False):
129129
def _guess_datetime_format_for_array(arr, dayfirst: bool | None = False) -> str | None:
130130
# Try to guess the format based on the first non-NaN element, return None if can't
131131
if (first_non_null := tslib.first_non_null(arr)) != -1:
132-
if type(first_non_nan_element := arr[first_non_null]) is str: # noqa: E721
132+
if type(first_non_nan_element := arr[first_non_null]) is str:
133133
# GH#32264 np.str_ object
134134
guessed_format = guess_datetime_format(
135135
first_non_nan_element, dayfirst=dayfirst

pandas/tests/frame/test_repr.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ def test_repr_should_return_str(self):
3838
index1 = ["\u03c3", "\u03c4", "\u03c5", "\u03c6"]
3939
cols = ["\u03c8"]
4040
df = DataFrame(data, columns=cols, index=index1)
41-
assert type(df.__repr__()) is str # noqa: E721
41+
assert type(df.__repr__()) is str
4242

4343
ser = df[cols[0]]
44-
assert type(ser.__repr__()) is str # noqa: E721
44+
assert type(ser.__repr__()) is str
4545

4646
def test_repr_bytes_61_lines(self):
4747
# GH#12857

pyproject.toml

+2
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,8 @@ ignore = [
318318
"RUF007",
319319
# mutable-class-default
320320
"RUF012",
321+
# type-comparison
322+
"E721",
321323

322324
# Additional pylint rules
323325
# literal-membership

0 commit comments

Comments
 (0)