Skip to content

Commit de578bd

Browse files
committed
pre-commit autoupdate (except for black formatter)
1 parent 615eadf commit de578bd

File tree

16 files changed

+33
-35
lines changed

16 files changed

+33
-35
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ repos:
1919
types_or: [python, rst, markdown]
2020
files: ^(pandas|doc)/
2121
- repo: https://github.com/pre-commit/pre-commit-hooks
22-
rev: v3.4.0
22+
rev: v4.0.1
2323
hooks:
2424
- id: debug-statements
2525
- id: end-of-file-fixer
2626
exclude: \.txt$
2727
- id: trailing-whitespace
2828
- repo: https://github.com/cpplint/cpplint
29-
rev: f7061b1 # the latest tag does not have the hook
29+
rev: 1.5.5
3030
hooks:
3131
- id: cpplint
3232
# We don't lint all C files because we don't want to lint any that are built
@@ -57,7 +57,7 @@ repos:
5757
hooks:
5858
- id: isort
5959
- repo: https://github.com/asottile/pyupgrade
60-
rev: v2.12.0
60+
rev: v2.18.3
6161
hooks:
6262
- id: pyupgrade
6363
args: [--py37-plus]
@@ -72,7 +72,7 @@ repos:
7272
types: [text] # overwrite types: [rst]
7373
types_or: [python, rst]
7474
- repo: https://github.com/asottile/yesqa
75-
rev: v1.2.2
75+
rev: v1.2.3
7676
hooks:
7777
- id: yesqa
7878
additional_dependencies:

doc/sphinxext/announce.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
def get_authors(revision_range):
5656
pat = "^.*\\t(.*)$"
57-
lst_release, cur_release = [r.strip() for r in revision_range.split("..")]
57+
lst_release, cur_release = (r.strip() for r in revision_range.split(".."))
5858

5959
if "|" in cur_release:
6060
# e.g. v1.0.1|HEAD
@@ -119,7 +119,7 @@ def get_pull_requests(repo, revision_range):
119119

120120

121121
def build_components(revision_range, heading="Contributors"):
122-
lst_release, cur_release = [r.strip() for r in revision_range.split("..")]
122+
lst_release, cur_release = (r.strip() for r in revision_range.split(".."))
123123
authors = get_authors(revision_range)
124124

125125
return {

pandas/_config/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def _describe_option(pat: str = "", _print_desc: bool = True):
157157
if len(keys) == 0:
158158
raise OptionError("No such keys(s)")
159159

160-
s = "\n".join([_build_option_description(k) for k in keys])
160+
s = "\n".join(_build_option_description(k) for k in keys)
161161

162162
if _print_desc:
163163
print(s)

pandas/core/reshape/merge.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,7 +1475,7 @@ def get_join_indexers(
14751475
for n in range(len(left_keys))
14761476
)
14771477
zipped = zip(*mapped)
1478-
llab, rlab, shape = [list(x) for x in zipped]
1478+
llab, rlab, shape = (list(x) for x in zipped)
14791479

14801480
# get flat i8 keys from label lists
14811481
lkey, rkey = _get_join_keys(llab, rlab, shape, sort)
@@ -1985,7 +1985,7 @@ def _get_multiindex_indexer(
19851985
for n in range(index.nlevels)
19861986
)
19871987
zipped = zip(*mapped)
1988-
rcodes, lcodes, shape = [list(x) for x in zipped]
1988+
rcodes, lcodes, shape = (list(x) for x in zipped)
19891989
if sort:
19901990
rcodes = list(map(np.take, rcodes, index.codes))
19911991
else:

pandas/core/reshape/tile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def cut(
250250
raise ValueError("Cannot cut empty array")
251251

252252
rng = (nanops.nanmin(x), nanops.nanmax(x))
253-
mn, mx = [mi + 0.0 for mi in rng]
253+
mn, mx = (mi + 0.0 for mi in rng)
254254

255255
if np.isinf(mn) or np.isinf(mx):
256256
# GH 24314

pandas/io/formats/excel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ def _generate_body(self, coloffset: int) -> Iterable[ExcelCell]:
773773
series = self.df.iloc[:, colidx]
774774
for i, val in enumerate(series):
775775
if styles is not None:
776-
css = ";".join([a + ":" + str(v) for (a, v) in styles[i, colidx]])
776+
css = ";".join(a + ":" + str(v) for (a, v) in styles[i, colidx])
777777
xlstyle = self.style_converter(css)
778778
yield ExcelCell(self.rowcounter + i, colidx + coloffset, val, xlstyle)
779779

pandas/io/formats/latex.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def get_result(self) -> str:
361361
self.bottom_separator,
362362
self.env_end,
363363
]
364-
result = "\n".join([item for item in elements if item])
364+
result = "\n".join(item for item in elements if item)
365365
trailing_newline = "\n"
366366
result += trailing_newline
367367
return result
@@ -530,13 +530,13 @@ def env_begin(self) -> str:
530530
f"\\begin{{longtable}}{self._position_macro}{{{self.column_format}}}"
531531
)
532532
elements = [first_row, f"{self._caption_and_label()}"]
533-
return "\n".join([item for item in elements if item])
533+
return "\n".join(item for item in elements if item)
534534

535535
def _caption_and_label(self) -> str:
536536
if self.caption or self.label:
537537
double_backslash = "\\\\"
538538
elements = [f"{self._caption_macro}", f"{self._label_macro}"]
539-
caption_and_label = "\n".join([item for item in elements if item])
539+
caption_and_label = "\n".join(item for item in elements if item)
540540
caption_and_label += double_backslash
541541
return caption_and_label
542542
else:
@@ -614,7 +614,7 @@ def env_begin(self) -> str:
614614
f"{self._label_macro}",
615615
f"\\begin{{tabular}}{{{self.column_format}}}",
616616
]
617-
return "\n".join([item for item in elements if item])
617+
return "\n".join(item for item in elements if item)
618618

619619
@property
620620
def bottom_separator(self) -> str:

pandas/io/html.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ def _build_xpath_expr(attrs) -> str:
627627
if "class_" in attrs:
628628
attrs["class"] = attrs.pop("class_")
629629

630-
s = " and ".join([f"@{k}={repr(v)}" for k, v in attrs.items()])
630+
s = " and ".join(f"@{k}={repr(v)}" for k, v in attrs.items())
631631
return f"[{s}]"
632632

633633

pandas/io/pytables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3513,7 +3513,7 @@ def validate_version(self, where=None):
35133513
""" are we trying to operate on an old version? """
35143514
if where is not None:
35153515
if self.version[0] <= 0 and self.version[1] <= 10 and self.version[2] < 1:
3516-
ws = incompatibility_doc % ".".join([str(x) for x in self.version])
3516+
ws = incompatibility_doc % ".".join(str(x) for x in self.version)
35173517
warnings.warn(ws, IncompatibilityWarning)
35183518

35193519
def validate_min_itemsize(self, min_itemsize):

pandas/tests/generic/test_frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def finalize(self, other, method=None, **kwargs):
126126
for name in self._metadata:
127127
if method == "concat":
128128
value = "+".join(
129-
[getattr(o, name) for o in other.objs if getattr(o, name, None)]
129+
getattr(o, name) for o in other.objs if getattr(o, name, None)
130130
)
131131
object.__setattr__(self, name, value)
132132
else:

0 commit comments

Comments
 (0)