Skip to content

Commit 32f55f6

Browse files
fix noqa comments + isort
1 parent f75fef5 commit 32f55f6

File tree

8 files changed

+21
-23
lines changed

8 files changed

+21
-23
lines changed

pandas/api/extensions/__init__.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
)
66

77
from pandas.core.accessor import ( # noqa: F401
8+
register_dataframe_accessor,
89
register_index_accessor,
910
register_series_accessor,
1011
)
1112
from pandas.core.algorithms import take # noqa: F401
1213
from pandas.core.arrays import ExtensionArray, ExtensionScalarOpsMixin # noqa: F401
13-
14-
from pandas.core.accessor import register_dataframe_accessor # noqa: F401; noqa: F401

pandas/tests/arrays/categorical/test_constructors.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ def test_constructor(self):
224224

225225
# this is a legitimate constructor
226226
with tm.assert_produces_warning(None):
227-
c = Categorical(
228-
np.array([], dtype="int64"), categories=[3, 2, 1], ordered=True # noqa
227+
c = Categorical( # noqa
228+
np.array([], dtype="int64"), categories=[3, 2, 1], ordered=True
229229
)
230230

231231
def test_constructor_with_existing_categories(self):

pandas/tests/arrays/sparse/test_array.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -689,13 +689,13 @@ def test_getslice_tuple(self):
689689
dense = np.array([np.nan, 0, 3, 4, 0, 5, np.nan, np.nan, 0])
690690

691691
sparse = SparseArray(dense)
692-
res = sparse[4:,]
693-
exp = SparseArray(dense[4:,])
692+
res = sparse[4:,] # noqa: E231
693+
exp = SparseArray(dense[4:,]) # noqa: E231
694694
tm.assert_sp_array_equal(res, exp)
695695

696696
sparse = SparseArray(dense, fill_value=0)
697-
res = sparse[4:,]
698-
exp = SparseArray(dense[4:,], fill_value=0)
697+
res = sparse[4:,] # noqa: E231
698+
exp = SparseArray(dense[4:,], fill_value=0) # noqa: E231
699699
tm.assert_sp_array_equal(res, exp)
700700

701701
with pytest.raises(IndexError):

pandas/tests/frame/test_alter_axes.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,8 @@ def test_set_index_pass_arrays_duplicate(
238238
# cannot drop the same column twice;
239239
# use "is" because == would give ambiguous Boolean error for containers
240240
first_drop = (
241-
False if (keys[0] is "A" and keys[1] is "A") else drop
242-
) # noqa: F632
243-
241+
False if (keys[0] is "A" and keys[1] is "A") else drop # noqa: F632
242+
)
244243
# to test against already-tested behaviour, we add sequentially,
245244
# hence second append always True; must wrap keys in list, otherwise
246245
# box = list would be interpreted as keys

pandas/tests/frame/test_analytics.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2135,8 +2135,8 @@ def test_round(self):
21352135
nan_round_Series = Series({"col1": np.nan, "col2": 1})
21362136

21372137
# TODO(wesm): unused?
2138-
expected_nan_round = DataFrame(
2139-
{"col1": [1.123, 2.123, 3.123], "col2": [1.2, 2.2, 3.2]} # noqa
2138+
expected_nan_round = DataFrame( # noqa
2139+
{"col1": [1.123, 2.123, 3.123], "col2": [1.2, 2.2, 3.2]}
21402140
)
21412141

21422142
with pytest.raises(TypeError):

pandas/tests/frame/test_query_eval.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ def test_ops(self):
102102
("/", "__truediv__", "__rtruediv__"),
103103
]:
104104

105-
base = DataFrame(
106-
np.tile(m.values, n).reshape(n, -1), columns=list("abcd") # noqa
105+
base = DataFrame( # noqa
106+
np.tile(m.values, n).reshape(n, -1), columns=list("abcd")
107107
)
108108

109109
expected = eval("base{op}df".format(op=op_str))

pandas/tests/indexing/test_callable.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ def test_frame_loc_callable(self):
1717
res = df.loc[lambda x: x.A > 2]
1818
tm.assert_frame_equal(res, df.loc[df.A > 2])
1919

20-
res = df.loc[lambda x: x.A > 2,]
21-
tm.assert_frame_equal(res, df.loc[df.A > 2,])
20+
res = df.loc[lambda x: x.A > 2,] # noqa: E231
21+
tm.assert_frame_equal(res, df.loc[df.A > 2,]) # noqa: E231
2222

23-
res = df.loc[lambda x: x.A > 2,]
24-
tm.assert_frame_equal(res, df.loc[df.A > 2,])
23+
res = df.loc[lambda x: x.A > 2,] # noqa: E231
24+
tm.assert_frame_equal(res, df.loc[df.A > 2,]) # noqa: E231
2525

2626
res = df.loc[lambda x: x.B == "b", :]
2727
tm.assert_frame_equal(res, df.loc[df.B == "b", :])
@@ -90,8 +90,8 @@ def test_frame_loc_callable_labels(self):
9090
res = df.loc[lambda x: ["A", "C"]]
9191
tm.assert_frame_equal(res, df.loc[["A", "C"]])
9292

93-
res = df.loc[lambda x: ["A", "C"],]
94-
tm.assert_frame_equal(res, df.loc[["A", "C"],])
93+
res = df.loc[lambda x: ["A", "C"],] # noqa: E231
94+
tm.assert_frame_equal(res, df.loc[["A", "C"],]) # noqa: E231
9595

9696
res = df.loc[lambda x: ["A", "C"], :]
9797
tm.assert_frame_equal(res, df.loc[["A", "C"], :])

pandas/tests/test_strings.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1839,13 +1839,13 @@ def test_ismethods(self):
18391839
digit_e = [False, False, False, True, False, False, False, True, False, False]
18401840

18411841
# TODO: unused
1842-
num_e = [
1842+
num_e = [ # noqa
18431843
False,
18441844
False,
18451845
False,
18461846
True,
18471847
False,
1848-
False, # noqa
1848+
False,
18491849
False,
18501850
True,
18511851
False,

0 commit comments

Comments
 (0)