8000 CLN: remove empty parenteses on class creation (#26323) · pandas-dev/pandas@ee6b131 · GitHub
[go: up one dir, main page]

Skip to content

Commit ee6b131

Browse files
topper-123jschendel
authored andcommitted
CLN: remove empty parenteses on class creation (#26323)
1 parent 17247ed commit ee6b131

20 files changed

+32
-32
lines changed

ci/code_checks.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then
148148
invgrep -R --include="*.py" --include="*.pyx" -E "(DEPRECATED|DEPRECATE|Deprecated)(:|,|\.)" pandas
149149
RET=$(($RET + $?)) ; echo $MSG "DONE"
150150

151-
MSG='Check for python2 new-style classes' ; echo $MSG
152-
invgrep -R --include="*.py" --include="*.pyx" -E "class\s\S*\(object\):" pandas scripts
151+
MSG='Check for python2 new-style classes and for for empty parenteses' ; echo $MSG
152+
invgrep -R --include="*.py" --include="*.pyx" -E "class\s\S*\((object)?\):" pandas scripts
153153
RET=$(($RET + $?)) ; echo $MSG "DONE"
154154

155155
MSG='Check for backticks incorrectly rendering because of missing spaces' ; echo $MSG

pandas/tests/dtypes/test_inference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ def test_mixed_dtypes_remain_object_array(self):
497497
class TestTypeInference:
498498

499499
# Dummy class used for testing with Python objects
500-
class Dummy():
500+
class Dummy:
501501
pass
502502

503503
def test_inferred_dtype_fixture(self, any_skipna_inferred_dtype):

pandas/tests/frame/test_alter_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import pandas.util.testing as tm
1414

1515

16-
class TestDataFrameAlterAxes():
16+
class TestDataFrameAlterAxes:
1717

1818
def test_set_index_directly(self, float_string_frame):
1919
df = float_string_frame

pandas/tests/frame/test_apply.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def int_frame_const_col():
2929
return df
3030

3131

32-
class TestDataFrameApply():
32+
class TestDataFrameApply:
3333

3434
def test_apply(self, float_frame):
3535
with np.errstate(all='ignore'):
@@ -829,7 +829,7 @@ def zip_frames(frames, axis=1):
829829
return pd.DataFrame(zipped)
830830

831831

832-
class TestDataFrameAggregate():
832+
class TestDataFrameAggregate:
833833

834834
def test_agg_transform(self, axis, float_frame):
835835
other_axis = 1 if axis in {0, 'index'} else 0

pandas/tests/frame/test_asof.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def date_range_frame():
1717
return DataFrame({'A': np.arange(N), 'B': np.arange(N)}, index=rng)
1818

1919

20-
class TestFrameAsof():
20+
class TestFrameAsof:
2121

2222
def test_basic(self, date_range_frame):
2323
df = date_range_frame
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# structure
2020

2121

22-
class TestDataFrameBlockInternals():
22+
class TestDataFrameBlockInternals:
2323
def test_setitem_invalidates_datetime_index_freq(self):
2424
# GH#24096 altering a datetime64tz column inplace invalidates the
2525
# `freq` attribute on the underlying DatetimeIndex
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from pandas.util.testing import assert_frame_equal, assert_series_equal
1010

1111

12-
class TestDataFrameConcatCommon():
12+
class TestDataFrameConcatCommon:
1313

1414
def test_concat_multiple_frames_dtypes(self):
1515

@@ -530,7 +530,7 @@ def test_concat_astype_dup_col(self):
530530
tm.assert_frame_equal(result, expected)
531531

532532

533-
class TestDataFrameCombineFirst():
533+
class TestDataFrameCombineFirst:
534534

535535
def test_combine_first_mixed(self):
536536
a = Series(['a', 'b'], index=range(2))
@@ -865,7 +865,7 @@ def test_concat_datetime_datetime64_frame(self):
865865
pd.concat([df1, df2_obj])
866866

867867

868-
class TestDataFrameUpdate():
868+
class TestDataFrameUpdate:
869869

870870
def test_update_nan(self):
871871
# #15593 #15617
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ def __len__(self, n):
10011001

10021002
def test_constructor_iterable(self):
10031003
# GH 21987
1004-
class Iter():
1004+
class Iter:
10051005
def __iter__(self):
10061006
for i in range(10):
10071007
yield [1, 2, 3]
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def _skip_if_no_pchip():
2121
pytest.skip('scipy.interpolate.pchip missing')
2222

2323

24-
class TestDataFrameMissingData():
24+
class TestDataFrameMissingData:
2525

2626
def test_dropEmptyRows(self, float_frame):
2727
N = len(float_frame.index)
@@ -643,7 +643,7 @@ def test_fill_value_when_combine_const(self):
643643
assert_frame_equal(res, exp)
644644

645645

646-
class TestDataFrameInterpolate():
646+
class TestDataFrameInterpolate:
647647

648648
def test_interp_basic(self):
649649
df = DataFrame({'A': [1, 2, np.nan, 4],
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# Column add, remove, delete.
1111

1212

13-
class TestDataFrameMutateColumns():
13+
class TestDataFrameMutateColumns:
1414

1515
def test_assign(self):
1616
df = DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})