Repository: pandas-dev/pandas
Pull request: CI: Update version of 'black'
closes #35925 

Not many files left so am making a PR to close this off

Problem statement:
CLN remove unnecessary trailing commas to get ready for new version of black
The new version of `black` is consistent in how it handles the magic trailing commas. So if we upgrade `black` and apply it, lots of files will be changed. However, the diff needn't be so large if we remove unnecessary trailing commas before upgrading.

E.g. in pandas/core/aggregation.py there is

```python
def reconstruct_func(
    func: Optional[AggFuncType], **kwargs,
) -> Tuple[
    bool, Optional[AggFuncType], Optional[List[str]], Optional[List[int]],
]:
```

which has an unnecessary trailing comma.

The new version of `black` would transform this as

```python
def reconstruct_func(
    func: Optional[AggFuncType],
    **kwargs,
) -> Tuple[bool, Optional[AggFuncType], Optional[List[str]], Optional[List[int]],]:
```

However, if we instead remove the trailing comma and write it as

```python
def reconstruct_func(
    func: Optional[AggFuncType], **kwargs
) -> Tuple[bool, Optional[AggFuncType], Optional[List[str]], Optional[List[int]]]:
```

then both the current and the new versions of black will be OK with it.

So, PRs to remove some unnecessary trailing commas would be welcome - perhaps keep each PR limited to 5-10 files changed.

Files that (may) need changing are:

- [ ] /asv_bench/benchmarks/arithmetic.py
- [ ] /pandas/core/array_algos/replace.py
- [x] /doc/make.py
- [ ] /doc/source/conf.py
- [ ] /pandas/core/aggregation.py
- [ ] /pandas/core/algorithms.py
- [ ] /pandas/_vendored/typing_extensions.py
- [ ] /pandas/core/util/numba_.py
- [ ] /pandas/core/sorting.py
- [ ] /pandas/io/formats/latex.py
- [ ] /pandas/core/series.py
- [ ] /pandas/io/formats/format.py
- [ ] /pandas/core/frame.py
- [ ] /pandas/tests/arrays/sparse/test_array.py
- [ ] /pandas/tests/frame/test_analytics.py
- [x] /pandas/tests/indexes/base_class/test_indexing.py
- [x] /pandas/tests/indexes/test_common.py
- [x] /pandas/tests/indexes/test_numeric.py
- [ ] /pandas/tests/io/test_gcs.py
- [ ] /pandas/tests/io/test_parquet.py
- [ ] /pandas/tests/scalar/timestamp/test_constructors.py
- [ ] /pandas/tests/series/test_operators.py
- [ ] /scripts/tests/test_validate_docstrings.py

EDIT
----
updated list of files which need changing

Hints from issue discussion:
See https://github.com/pandas-dev/pandas/pull/35930, #35949, #35950 and  for examples of how to open a PR for this.

No need to ask for permission to work on this, just choose a few files to work on and open a PR (optionally, you can comment here indicating that you're working on them)
I think the easiest way to find them is actually to let black (using the latest version) reformat the file(s), and then check in the diff for which ones the trailing comma can be removed (and then run black again)
I am looking at these right now

- [ ] pandas/core/internals/concat.py
- [ ] pandas/core/internals/managers.py
- [ ] pandas/core/internals/ops.py
- [ ] pandas/core/nanops.py
- [ ] pandas/core/ops/docstrings.py
- [ ] pandas/core/reshape/concat.py
- [ ] pandas/core/reshape/pivot.py
- [ ] pandas/core/reshape/reshape.py

edit: https://github.com/pandas-dev/pandas/pull/35956

@MarcoGorelli if it looks good I can open another with some more later today.
@jpribyl thanks! Yes, feel free to do so, any help here would be appreciated!
https://github.com/pandas-dev/pandas/pull/35959

with several more files:
- pandas/core/series.py
- pandas/core/window/ewm.py
- pandas/core/window/indexers.py
- pandas/core/window/numba_.py
- pandas/core/window/rolling.py
- pandas/io/formats/css.py
- pandas/io/formats/format.py
- pandas/io/orc.py
working on these right now:

-  pandas/tests/test_multilevel.py
-  pandas/tests/test_nanops.py
-  pandas/tests/window/moments/test_moments_consistency_rolling.py
-  pandas/tests/window/moments/test_moments_ewm.py
-  pandas/tests/window/moments/test_moments_rolling.py
-  pandas/tests/window/test_base_indexer.py
-  pandas/tests/window/test_pairwise.py
-  pandas/tests/window/test_rolling.py
-  pandas/tseries/frequencies.py
-  pandas/util/_test_decorators.py

#35996
I'm searching using this regex: `,\n? *\)|,\n? *\]` What do you guys think? Is it the correct way?

Edit: `,\n? *(\)|\]|\})`
> I'm searching using this regex: `,\n? *\)|,\n? *\]` What do you guys think? Is it the correct way?
> 
> Edit: `,\n? *(\)|\]|\})`

I would just upgrade `black`, run it on the chosen files, see what's changed, remove trailing commas, and run `black` again
> I would just upgrade `black`, run it on the chosen files, see what's changed, remove trailing commas, and run `black` again

@MarcoGorelli when I am running black again, it changes file back with trailing commas


> > I would just upgrade `black`, run it on the chosen files, see what's changed, remove trailing commas, and run `black` again
> 
> @MarcoGorelli when I am running black again, it changes file back with trailing commas

That's fine. Two things may happen when running the new version of `black`:
- the command is long, and so it splits it into multiple lines, each with a trailing comma;
- the command is short, and so it puts it all on one line.

It's the second case in which we want to remove the trailing commas, so that both the current and the new version of `black` would reformat that line in the same way.

From a quick glance it looks like you've done it correctly anyway, will review later today

Commit message: remove trailing commas

Patch to review:
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 309e22e71a523..dd5323960ed20 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,6 +1,6 @@
 repos:
 -   repo: https://github.com/python/black
-    rev: 19.10b0
+    rev: 20.8b1
     hooks:
     -   id: black
         language_version: python3
diff --git a/asv_bench/benchmarks/arithmetic.py b/asv_bench/benchmarks/arithmetic.py
index 3ef6ab6209ea7..5a3febdcf75e7 100644
--- a/asv_bench/benchmarks/arithmetic.py
+++ b/asv_bench/benchmarks/arithmetic.py
@@ -125,7 +125,7 @@ def setup(self, op):
         arr1 = np.random.randn(n_rows, int(n_cols / 2)).astype("f8")
         arr2 = np.random.randn(n_rows, int(n_cols / 2)).astype("f4")
         df = pd.concat(
-            [pd.DataFrame(arr1), pd.DataFrame(arr2)], axis=1, ignore_index=True,
+            [pd.DataFrame(arr1), pd.DataFrame(arr2)], axis=1, ignore_index=True
         )
         # should already be the case, but just to be sure
         df._consolidate_inplace()
diff --git a/doc/make.py b/doc/make.py
index 94fbfa9382d81..40ce9ea3bbcd2 100755
--- a/doc/make.py
+++ b/doc/make.py
@@ -286,7 +286,7 @@ def main():
 
     joined = ",".join(cmds)
     argparser = argparse.ArgumentParser(
-        description="pandas documentation builder", epilog=f"Commands: {joined}",
+        description="pandas documentation builder", epilog=f"Commands: {joined}"
     )
 
     joined = ", ".join(cmds)
diff --git a/doc/source/conf.py b/doc/source/conf.py
index ee0d4ca3f2a24..04540f7e6ec95 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -308,7 +308,7 @@
 
     for method in methods:
         # ... and each of its public methods
-        moved_api_pages.append((f"{old}.{method}", f"{new}.{method}",))
+        moved_api_pages.append((f"{old}.{method}", f"{new}.{method}"))
 
 if pattern is None:
     html_additional_pages = {
diff --git a/doc/source/development/contributing.rst b/doc/source/development/contributing.rst
index e5c6f77eea3ef..8558774955a40 100644
--- a/doc/source/development/contributing.rst
+++ b/doc/source/development/contributing.rst
@@ -720,7 +720,7 @@ submitting code to run the check yourself::
 to auto-format your code. Additionally, many editors have plugins that will
 apply ``black`` as you edit files.
 
-You should use a ``black`` version >= 19.10b0 as previous versions are not compatible
+You should use a ``black`` version 20.8b1 as previous versions are not compatible
 with the pandas codebase.
 
 If you wish to run these checks automatically, we encourage you to use
diff --git a/environment.yml b/environment.yml
index 36bbd3d307159..ffd319b006ff2 100644
--- a/environment.yml
+++ b/environment.yml
@@ -15,7 +15,7 @@ dependencies:
   - cython>=0.29.21
 
   # code checks
-  - black=19.10b0
+  - black=20.8b1
   - cpplint
   - flake8<3.8.0  # temporary pin, GH#34150
   - flake8-comprehensions>=3.1.0  # used by flake8, linting of unnecessary comprehensions
diff --git a/pandas/_vendored/typing_extensions.py b/pandas/_vendored/typing_extensions.py
index 129d8998faccc..6efbbe9302952 100644
--- a/pandas/_vendored/typing_extensions.py
+++ b/pandas/_vendored/typing_extensions.py
@@ -2116,8 +2116,7 @@ def __init_subclass__(cls, *args, **kwargs):
             raise TypeError(f"Cannot subclass {cls.__module__}.Annotated")
 
     def _strip_annotations(t):
-        """Strips the annotations from a given type.
-        """
+        """Strips the annotations from a given type."""
         if isinstance(t, _AnnotatedAlias):
             return _strip_annotations(t.__origin__)
         if isinstance(t, typing._GenericAlias):
diff --git a/pandas/core/aggregation.py b/pandas/core/aggregation.py
index c123156495924..541c617f7f618 100644
--- a/pandas/core/aggregation.py
+++ b/pandas/core/aggregation.py
@@ -387,7 +387,7 @@ def validate_func_kwargs(
 
 
 def transform(
-    obj: FrameOrSeries, func: AggFuncType, axis: Axis, *args, **kwargs,
+    obj: FrameOrSeries, func: AggFuncType, axis: Axis, *args, **kwargs
 ) -> FrameOrSeries:
     """
     Transform a DataFrame or Series
diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py
index 50d1810fee30d..ccccdc4409694 100644
--- a/pandas/core/algorithms.py
+++ b/pandas/core/algorithms.py
@@ -1023,11 +1023,10 @@ def checked_add_with_arr(arr, b, arr_mask=None, b_mask=None):
         to_raise = ((np.iinfo(np.int64).max - b2 < arr) & not_nan).any()
     else:
         to_raise = (
-            ((np.iinfo(np.int64).max - b2[mask1] < arr[mask1]) & not_nan[mask1]).any()
-            or (
-                (np.iinfo(np.int64).min - b2[mask2] > arr[mask2]) & not_nan[mask2]
-            ).any()
-        )
+            (np.iinfo(np.int64).max - b2[mask1] < arr[mask1]) & not_nan[mask1]
+        ).any() or (
+            (np.iinfo(np.int64).min - b2[mask2] > arr[mask2]) & not_nan[mask2]
+        ).any()
 
     if to_raise:
         raise OverflowError("Overflow in int64 addition")
diff --git a/pandas/core/array_algos/replace.py b/pandas/core/array_algos/replace.py
index 09f9aefd64096..9eaa265adab2b 100644
--- a/pandas/core/array_algos/replace.py
+++ b/pandas/core/array_algos/replace.py
@@ -17,7 +17,7 @@
 
 
 def compare_or_regex_search(
-    a: ArrayLike, b: Union[Scalar, Pattern], regex: bool, mask: ArrayLike,
+    a: ArrayLike, b: Union[Scalar, Pattern], regex: bool, mask: ArrayLike
 ) -> Union[ArrayLike, bool]:
     """
     Compare two array_like inputs of the same shape or two scalar values
diff --git a/pandas/core/frame.py b/pandas/core/frame.py
index 36dfe43bfd708..47b127b300681 100644
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -449,9 +449,7 @@ def __init__(
         if isinstance(data, BlockManager):
             if index is None and columns is None and dtype is None and copy is False:
                 # GH#33357 fastpath
-                NDFrame.__init__(
-                    self, data,
-                )
+                NDFrame.__init__(self, data)
                 return
 
             mgr = self._init_mgr(
@@ -5747,7 +5745,7 @@ def nsmallest(self, n, columns, keep="first") -> DataFrame:
                   population    GDP alpha-2
         Tuvalu         11300     38      TV
         Anguilla       11300    311      AI
-        Iceland       337000  17036	     IS
+        Iceland       337000  17036      IS
 
         When using ``keep='last'``, ties are resolved in reverse order:
 
@@ -7142,7 +7140,7 @@ def unstack(self, level=-1, fill_value=None):
 
         return unstack(self, level, fill_value)
 
-    @Appender(_shared_docs["melt"] % dict(caller="df.melt(", other="melt",))
+    @Appender(_shared_docs["melt"] % dict(caller="df.melt(", other="melt"))
     def melt(
         self,
         id_vars=None,
@@ -8624,7 +8622,7 @@ def blk_func(values):
             # After possibly _get_data and transposing, we are now in the
             #  simple case where we can use BlockManager.reduce
             res = df._mgr.reduce(blk_func)
-            out = df._constructor(res,).iloc[0].rename(None)
+            out = df._constructor(res).iloc[0].rename(None)
             if out_dtype is not None:
                 out = out.astype(out_dtype)
             if axis == 0 and is_object_dtype(out.dtype):
diff --git a/pandas/core/series.py b/pandas/core/series.py
index 48fae9a0a91cd..0984e86a23592 100644
--- a/pandas/core/series.py
+++ b/pandas/core/series.py
@@ -198,7 +198,7 @@ class Series(base.IndexOpsMixin, generic.NDFrame):
     # Constructors
 
     def __init__(
-        self, data=None, index=None, dtype=None, name=None, copy=False, fastpath=False,
+        self, data=None, index=None, dtype=None, name=None, copy=False, fastpath=False
     ):
 
         if (
@@ -208,9 +208,7 @@ def __init__(
             and copy is False
         ):
             # GH#33357 called with just the SingleBlockManager
-            NDFrame.__init__(
-                self, data,
-            )
+            NDFrame.__init__(self, data)
             self.name = name
             return
 
@@ -329,9 +327,7 @@ def __init__(
 
                 data = SingleBlockManager.from_array(data, index)
 
-        generic.NDFrame.__init__(
-            self, data,
-        )
+        generic.NDFrame.__init__(self, data)
         self.name = name
         self._set_axis(0, index, fastpath=True)
 
diff --git a/pandas/core/sorting.py b/pandas/core/sorting.py
index ec62192464665..1fec2bbbf5fdc 100644
--- a/pandas/core/sorting.py
+++ b/pandas/core/sorting.py
@@ -72,7 +72,7 @@ def get_indexer_indexer(
         )
     elif isinstance(target, ABCMultiIndex):
         indexer = lexsort_indexer(
-            target._get_codes_for_sorting(), orders=ascending, na_position=na_position,
+            target._get_codes_for_sorting(), orders=ascending, na_position=na_position
         )
     else:
         # Check monotonic-ness before sort an index (GH 11080)
diff --git a/pandas/core/util/numba_.py b/pandas/core/util/numba_.py
index f06dd10d0e497..1dd005c1602a5 100644
--- a/pandas/core/util/numba_.py
+++ b/pandas/core/util/numba_.py
@@ -25,7 +25,7 @@ def set_use_numba(enable: bool = False) -> None:
 
 
 def get_jit_arguments(
-    engine_kwargs: Optional[Dict[str, bool]] = None, kwargs: Optional[Dict] = None,
+    engine_kwargs: Optional[Dict[str, bool]] = None, kwargs: Optional[Dict] = None
 ) -> Tuple[bool, bool, bool]:
     """
     Return arguments to pass to numba.JIT, falling back on pandas default JIT settings.
diff --git a/pandas/io/formats/format.py b/pandas/io/formats/format.py
index 7eb31daa894c9..99992d0218a68 100644
--- a/pandas/io/formats/format.py
+++ b/pandas/io/formats/format.py
@@ -1382,10 +1382,6 @@ def _format(x):
 
 
 class FloatArrayFormatter(GenericArrayFormatter):
-    """
-
-    """
-
     def __init__(self, *args, **kwargs):
         super().__init__(*args, **kwargs)
 
diff --git a/pandas/io/formats/latex.py b/pandas/io/formats/latex.py
index eb35fff3a4f8e..a70cd771e76c2 100644
--- a/pandas/io/formats/latex.py
+++ b/pandas/io/formats/latex.py
@@ -41,9 +41,9 @@ def __init__(
         self.multirow = multirow
         self.clinebuf: List[List[int]] = []
         self.strcols = self._get_strcols()
-        self.strrows: List[List[str]] = (
-            list(zip(*self.strcols))  # type: ignore[arg-type]
-        )
+        self.strrows: List[List[str]] = list(
+            zip(*self.strcols)
+        )  # type: ignore[arg-type]
 
     def get_strrow(self, row_num: int) -> str:
         """Get string representation of the row."""
diff --git a/pandas/tests/arrays/sparse/test_array.py b/pandas/tests/arrays/sparse/test_array.py
index ece9367cea7fe..5d9bae65bd6ca 100644
--- a/pandas/tests/arrays/sparse/test_array.py
+++ b/pandas/tests/arrays/sparse/test_array.py
@@ -193,9 +193,7 @@ def test_constructor_inferred_fill_value(self, data, fill_value):
             assert result == fill_value
 
     @pytest.mark.parametrize("format", ["coo", "csc", "csr"])
-    @pytest.mark.parametrize(
-        "size", [0, 10],
-    )
+    @pytest.mark.parametrize("size", [0, 10])
     @td.skip_if_no_scipy
     def test_from_spmatrix(self, size, format):
         import scipy.sparse
@@ -693,17 +691,13 @@ def test_getslice_tuple(self):
         dense = np.array([np.nan, 0, 3, 4, 0, 5, np.nan, np.nan, 0])
 
         sparse = SparseArray(dense)
-        res = sparse[
-            4:,
-        ]  # noqa: E231
-        exp = SparseArray(dense[4:,])  # noqa: E231
+        res = sparse[4:]
+        exp = SparseArray(dense[4:])
         tm.assert_sp_array_equal(res, exp)
 
         sparse = SparseArray(dense, fill_value=0)
-        res = sparse[
-            4:,
-        ]  # noqa: E231
-        exp = SparseArray(dense[4:,], fill_value=0)  # noqa: E231
+        res = sparse[4:]
+        exp = SparseArray(dense[4:], fill_value=0)
         tm.assert_sp_array_equal(res, exp)
 
         msg = "too many indices for array"
diff --git a/pandas/tests/frame/test_analytics.py b/pandas/tests/frame/test_analytics.py
index f21b1d3dfe487..4324b03ed13d6 100644
--- a/pandas/tests/frame/test_analytics.py
+++ b/pandas/tests/frame/test_analytics.py
@@ -1060,14 +1060,14 @@ def test_any_all_bool_only(self):
             (np.any, {"A": pd.Series([0.0, 1.0], dtype="float")}, True),
             (np.all, {"A": pd.Series([0, 1], dtype=int)}, False),
             (np.any, {"A": pd.Series([0, 1], dtype=int)}, True),
-            pytest.param(np.all, {"A": pd.Series([0, 1], dtype="M8[ns]")}, False,),
-            pytest.param(np.any, {"A": pd.Series([0, 1], dtype="M8[ns]")}, True,),
-            pytest.param(np.all, {"A": pd.Series([1, 2], dtype="M8[ns]")}, True,),
-            pytest.param(np.any, {"A": pd.Series([1, 2], dtype="M8[ns]")}, True,),
-            pytest.param(np.all, {"A": pd.Series([0, 1], dtype="m8[ns]")}, False,),
-            pytest.param(np.any, {"A": pd.Series([0, 1], dtype="m8[ns]")}, True,),
-            pytest.param(np.all, {"A": pd.Series([1, 2], dtype="m8[ns]")}, True,),
-            pytest.param(np.any, {"A": pd.Series([1, 2], dtype="m8[ns]")}, True,),
+            pytest.param(np.all, {"A": pd.Series([0, 1], dtype="M8[ns]")}, False),
+            pytest.param(np.any, {"A": pd.Series([0, 1], dtype="M8[ns]")}, True),
+            pytest.param(np.all, {"A": pd.Series([1, 2], dtype="M8[ns]")}, True),
+            pytest.param(np.any, {"A": pd.Series([1, 2], dtype="M8[ns]")}, True),
+            pytest.param(np.all, {"A": pd.Series([0, 1], dtype="m8[ns]")}, False),
+            pytest.param(np.any, {"A": pd.Series([0, 1], dtype="m8[ns]")}, True),
+            pytest.param(np.all, {"A": pd.Series([1, 2], dtype="m8[ns]")}, True),
+            pytest.param(np.any, {"A": pd.Series([1, 2], dtype="m8[ns]")}, True),
             (np.all, {"A": pd.Series([0, 1], dtype="category")}, False),
             (np.any, {"A": pd.Series([0, 1], dtype="category")}, True),
             (np.all, {"A": pd.Series([1, 2], dtype="category")}, True),
diff --git a/pandas/tests/io/test_gcs.py b/pandas/tests/io/test_gcs.py
index 18b5743a3375a..9d179d983ceeb 100644
--- a/pandas/tests/io/test_gcs.py
+++ b/pandas/tests/io/test_gcs.py
@@ -108,9 +108,7 @@ def test_to_csv_compression_encoding_gcs(gcs_buffer, compression_only, encoding)
         compression_only = "gz"
     compression["method"] = "infer"
     path_gcs += f".{compression_only}"
-    df.to_csv(
-        path_gcs, compression=compression, encoding=encoding,
-    )
+    df.to_csv(path_gcs, compression=compression, encoding=encoding)
     assert gcs_buffer.getvalue() == buffer.getvalue()
     read_df = read_csv(path_gcs, index_col=0, compression="infer", encoding=encoding)
     tm.assert_frame_equal(df, read_df)
diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py
index 35a400cba8671..a5033c51bce81 100644
--- a/pandas/tests/io/test_parquet.py
+++ b/pandas/tests/io/test_parquet.py
@@ -572,7 +572,7 @@ def test_s3_roundtrip(self, df_compat, s3_resource, pa, s3so):
             pytest.param(
                 ["A"],
                 marks=pytest.mark.xfail(
-                    PY38, reason="Getting back empty DataFrame", raises=AssertionError,
+                    PY38, reason="Getting back empty DataFrame", raises=AssertionError
                 ),
             ),
             [],
diff --git a/pandas/tests/scalar/timestamp/test_constructors.py b/pandas/tests/scalar/timestamp/test_constructors.py
index 316a299ba1cbb..d1c3ad508d877 100644
--- a/pandas/tests/scalar/timestamp/test_constructors.py
+++ b/pandas/tests/scalar/timestamp/test_constructors.py
@@ -259,17 +259,20 @@ def test_constructor_keyword(self):
             Timestamp("20151112")
         )
 
-        assert repr(
-            Timestamp(
-                year=2015,
-                month=11,
-                day=12,
-                hour=1,
-                minute=2,
-                second=3,
-                microsecond=999999,
+        assert (
+            repr(
+                Timestamp(
+                    year=2015,
+                    month=11,
+                    day=12,
+                    hour=1,
+                    minute=2,
+                    second=3,
+                    microsecond=999999,
+                )
             )
-        ) == repr(Timestamp("2015-11-12 01:02:03.999999"))
+            == repr(Timestamp("2015-11-12 01:02:03.999999"))
+        )
 
     def test_constructor_fromordinal(self):
         base = datetime(2000, 1, 1)
diff --git a/pandas/tests/series/test_operators.py b/pandas/tests/series/test_operators.py
index aee947e738525..a796023c75b78 100644
--- a/pandas/tests/series/test_operators.py
+++ b/pandas/tests/series/test_operators.py
@@ -554,9 +554,7 @@ def test_unary_minus_nullable_int(
         expected = pd.Series(target, dtype=dtype)
         tm.assert_series_equal(result, expected)
 
-    @pytest.mark.parametrize(
-        "source", [[1, 2, 3], [1, 2, None], [-1, 0, 1]],
-    )
+    @pytest.mark.parametrize("source", [[1, 2, 3], [1, 2, None], [-1, 0, 1]])
     def test_unary_plus_nullable_int(self, any_signed_nullable_int_dtype, source):
         dtype = any_signed_nullable_int_dtype
         expected = pd.Series(source, dtype=dtype)
diff --git a/requirements-dev.txt b/requirements-dev.txt
index fb647c10f72bc..4f93ce9017f91 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -6,7 +6,7 @@ python-dateutil>=2.7.3
 pytz
 asv
 cython>=0.29.21
-black==19.10b0
+black==20.8b1
 cpplint
 flake8<3.8.0
 flake8-comprehensions>=3.1.0
diff --git a/scripts/tests/test_validate_docstrings.py b/scripts/tests/test_validate_docstrings.py
index b11de0c4ad860..74819db7b878c 100644
--- a/scripts/tests/test_validate_docstrings.py
+++ b/scripts/tests/test_validate_docstrings.py
@@ -6,8 +6,7 @@
 
 
 class BadDocstrings:
-    """Everything here has a bad docstring
-    """
+    """Everything here has a bad docstring"""
 
     def private_classes(self):
         """
diff --git a/versioneer.py b/versioneer.py
index 65c9523ba5573..171156c2c5315 100644
--- a/versioneer.py
+++ b/versioneer.py
@@ -1073,7 +1073,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
                 fmt = "tag '%s' doesn't start with prefix '%s'"
                 print(fmt % (full_tag, tag_prefix))
             pieces["error"] = "tag '{}' doesn't start with prefix '{}'".format(
-                full_tag, tag_prefix,
+                full_tag, tag_prefix
             )
             return pieces
         pieces["closest-tag"] = full_tag[len(tag_prefix) :]


Code review comments:
diff_hunk: @@ -693,17 +691,13 @@ def test_getslice_tuple(self):
         dense = np.array([np.nan, 0, 3, 4, 0, 5, np.nan, np.nan, 0])
 
         sparse = SparseArray(dense)
-        res = sparse[
-            4:,
-        ]  # noqa: E231
-        exp = SparseArray(dense[4:,])  # noqa: E231
+        res = sparse[4:]
path: pandas/tests/arrays/sparse/test_array.py
text: @user1:
since the test is called test_getslice_tuple

```suggestion
        res = sparse[(slice(4, None),)]
```

could be more appropriate?

@user2:
Ah, I missed the test name. So then it is probably indeed testing that passing a 1-len tuple is still working for a 1D array. Good catch!

@author:
yes, you're right, thanks, I should've caught that