Skip to content

Commit 9f6a91a

Browse files
github-actions[bot]jrebackMarcoGorelli
authored
⬆️ UPGRADE: Autoupdate pre-commit config (#42151)
* ⬆️ UPGRADE: Autoupdate pre-commit config * fixup new codespell error Co-authored-by: jreback <[email protected]> Co-authored-by: MarcoGorelli <[email protected]>
1 parent 3bb31da commit 9f6a91a

File tree

10 files changed

+16
-16
lines changed

10 files changed

+16
-16
lines changed

.pre-commit-config.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ repos:
99
- id: absolufy-imports
1010
files: ^pandas/
1111
- repo: https://github.com/python/black
12-
rev: 21.5b2
12+
rev: 21.6b0
1313
hooks:
1414
- id: black
1515
- repo: https://github.com/codespell-project/codespell
16-
rev: v2.0.0
16+
rev: v2.1.0
1717
hooks:
1818
- id: codespell
1919
types_or: [python, rst, markdown]
@@ -53,16 +53,16 @@ repos:
5353
types: [text]
5454
args: [--append-config=flake8/cython-template.cfg]
5555
- repo: https://github.com/PyCQA/isort
56-
rev: 5.8.0
56+
rev: 5.9.0
5757
hooks:
5858
- id: isort
5959
- repo: https://github.com/asottile/pyupgrade
60-
rev: v2.18.3
60+
rev: v2.19.4
6161
hooks:
6262
- id: pyupgrade
6363
args: [--py37-plus]
6464
- repo: https://github.com/pre-commit/pygrep-hooks
65-
rev: v1.8.0
65+
rev: v1.9.0
6666
hooks:
6767
- id: rst-backticks
6868
- id: rst-directive-colons

pandas/core/arrays/sparse/array.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,7 @@ def __array_ufunc__(self, ufunc: np.ufunc, method: str, *inputs, **kwargs):
14481448
sp_values, self.sp_index, SparseDtype(sp_values.dtype, fill_value)
14491449
)
14501450

1451-
result = getattr(ufunc, method)(*[np.asarray(x) for x in inputs], **kwargs)
1451+
result = getattr(ufunc, method)(*(np.asarray(x) for x in inputs), **kwargs)
14521452
if out:
14531453
if len(out) == 1:
14541454
out = out[0]

pandas/core/arrays/sparse/scipy_sparse.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def _get_label_to_i_dict(labels, sort_labels=False):
5858
return {k: i for i, k in enumerate(labels)}
5959

6060
def _get_index_subset_to_coord_dict(index, subset, sort_labels=False):
61-
ilabels = list(zip(*[index._get_level_values(i) for i in subset]))
61+
ilabels = list(zip(*(index._get_level_values(i) for i in subset)))
6262
labels_to_i = _get_label_to_i_dict(ilabels, sort_labels=sort_labels)
6363
labels_to_i = Series(labels_to_i)
6464
if len(subset) > 1:

pandas/core/missing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def interpolate_1d(
398398
# preserve NaNs on the inside
399399
preserve_nans |= mid_nans
400400

401-
# sort preserve_nans and covert to list
401+
# sort preserve_nans and convert to list
402402
preserve_nans = sorted(preserve_nans)
403403

404404
result = yvalues.copy()

pandas/core/reshape/melt.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def lreshape(data: DataFrame, groups, dropna: bool = True, label=None) -> DataFr
227227
else:
228228
keys, values = zip(*groups)
229229

230-
all_cols = list(set.union(*[set(x) for x in values]))
230+
all_cols = list(set.union(*(set(x) for x in values)))
231231
id_cols = list(data.columns.difference(all_cols))
232232

233233
K = len(values[0])

pandas/io/formats/format.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ def space_format(x, y):
861861
return y
862862

863863
str_columns = list(
864-
zip(*[[space_format(x, y) for y in x] for x in fmt_columns])
864+
zip(*([space_format(x, y) for y in x] for x in fmt_columns))
865865
)
866866
if self.sparsify and len(str_columns):
867867
str_columns = sparsify_labels(str_columns)

pandas/io/sql.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ def insert(self, chunksize: int | None = None, method: str | None = None):
963963
if start_i >= end_i:
964964
break
965965

966-
chunk_iter = zip(*[arr[start_i:end_i] for arr in data_list])
966+
chunk_iter = zip(*(arr[start_i:end_i] for arr in data_list))
967967
exec_insert(conn, keys, chunk_iter)
968968

969969
def _query_iterator(

pandas/tests/frame/methods/test_describe.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def test_describe_percentiles_integer_idx(self):
346346
result = df.describe(percentiles=pct)
347347

348348
expected = DataFrame(
349-
{"x": [1.0, 1.0, np.NaN, 1.0, *[1.0 for _ in pct], 1.0]},
349+
{"x": [1.0, 1.0, np.NaN, 1.0, *(1.0 for _ in pct), 1.0]},
350350
index=[
351351
"count",
352352
"mean",

pandas/tests/frame/test_arithmetic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ def test_df_arith_2d_array_collike_broadcasts(self, all_arithmetic_operators):
763763
if opname in ["__rmod__", "__rfloordiv__"]:
764764
# Series ops may return mixed int/float dtypes in cases where
765765
# DataFrame op will return all-float. So we upcast `expected`
766-
dtype = np.common_type(*[x.values for x in exvals.values()])
766+
dtype = np.common_type(*(x.values for x in exvals.values()))
767767

768768
expected = DataFrame(exvals, columns=df.columns, index=df.index, dtype=dtype)
769769

pandas/tests/indexing/test_categorical.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -485,17 +485,17 @@ def test_loc_and_at_with_categorical_index(self):
485485
[1.5, 2.5, 3.5],
486486
[-1.5, -2.5, -3.5],
487487
# numpy int/uint
488-
*[np.array([1, 2, 3], dtype=dtype) for dtype in tm.ALL_INT_DTYPES],
488+
*(np.array([1, 2, 3], dtype=dtype) for dtype in tm.ALL_INT_DTYPES),
489489
# numpy floats
490-
*[np.array([1.5, 2.5, 3.5], dtype=dtyp) for dtyp in tm.FLOAT_DTYPES],
490+
*(np.array([1.5, 2.5, 3.5], dtype=dtyp) for dtyp in tm.FLOAT_DTYPES),
491491
# numpy object
492492
np.array([1, "b", 3.5], dtype=object),
493493
# pandas scalars
494494
[Interval(1, 4), Interval(4, 6), Interval(6, 9)],
495495
[Timestamp(2019, 1, 1), Timestamp(2019, 2, 1), Timestamp(2019, 3, 1)],
496496
[Timedelta(1, "d"), Timedelta(2, "d"), Timedelta(3, "D")],
497497
# pandas Integer arrays
498-
*[pd.array([1, 2, 3], dtype=dtype) for dtype in tm.ALL_EA_INT_DTYPES],
498+
*(pd.array([1, 2, 3], dtype=dtype) for dtype in tm.ALL_EA_INT_DTYPES),
499499
# other pandas arrays
500500
pd.IntervalIndex.from_breaks([1, 4, 6, 9]).array,
501501
pd.date_range("2019-01-01", periods=3).array,

0 commit comments

Comments
 (0)