Skip to content

Commit 4e2546d

Browse files
ShaharNavehjbrockmendel
authored andcommitted
STY: wrong placed space in strings (pandas-dev#30940)
1 parent 28e909c commit 4e2546d

11 files changed

+32
-36
lines changed

pandas/tests/frame/test_missing.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -670,8 +670,8 @@ def test_fillna_invalid_value(self, float_frame):
670670
float_frame.fillna((1, 2))
671671
# frame with series
672672
msg = (
673-
'"value" parameter must be a scalar, dict or Series, but you'
674-
' passed a "DataFrame"'
673+
'"value" parameter must be a scalar, dict or Series, but you '
674+
'passed a "DataFrame"'
675675
)
676676
with pytest.raises(TypeError, match=msg):
677677
float_frame.iloc[:, 0].fillna(float_frame)

pandas/tests/frame/test_repr_info.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,13 @@ def test_repr_column_name_unicode_truncation_bug(self):
164164
"Id": [7117434],
165165
"StringCol": (
166166
"Is it possible to modify drop plot code"
167-
" so that the output graph is displayed "
167+
"so that the output graph is displayed "
168168
"in iphone simulator, Is it possible to "
169169
"modify drop plot code so that the "
170170
"output graph is \xe2\x80\xa8displayed "
171171
"in iphone simulator.Now we are adding "
172-
"the CSV file externally. I want to Call"
173-
" the File through the code.."
172+
"the CSV file externally. I want to Call "
173+
"the File through the code.."
174174
),
175175
}
176176
)

pandas/tests/frame/test_reshape.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,8 @@ def test_stack_mixed_levels(self):
424424
# When mixed types are passed and the ints are not level
425425
# names, raise
426426
msg = (
427-
"level should contain all level names or all level numbers, not"
428-
" a mixture of the two"
427+
"level should contain all level names or all level numbers, not "
428+
"a mixture of the two"
429429
)
430430
with pytest.raises(ValueError, match=msg):
431431
df2.stack(level=["animal", 0])

pandas/tests/groupby/test_grouping.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -725,10 +725,7 @@ def test_get_group(self):
725725
g.get_group("foo")
726726
with pytest.raises(ValueError, match=msg):
727727
g.get_group(("foo"))
728-
msg = (
729-
"must supply a same-length tuple to get_group with multiple"
730-
" grouping keys"
731-
)
728+
msg = "must supply a same-length tuple to get_group with multiple grouping keys"
732729
with pytest.raises(ValueError, match=msg):
733730
g.get_group(("foo", "bar", "baz"))
734731

pandas/tests/plotting/test_datetimelike.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ def test_both_style_and_color(self):
121121
ts = tm.makeTimeSeries()
122122
msg = (
123123
"Cannot pass 'style' string with a color symbol and 'color' "
124-
"keyword argument. Please use one or the other or pass 'style'"
125-
" without a color symbol"
124+
"keyword argument. Please use one or the other or pass 'style' "
125+
"without a color symbol"
126126
)
127127
with pytest.raises(ValueError, match=msg):
128128
ts.plot(style="b-", color="#000099")

pandas/tests/plotting/test_misc.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ def test_subplot_titles(self, iris):
319319

320320
# Case len(title) > len(df)
321321
msg = (
322-
"The length of `title` must equal the number of columns if"
323-
" using `title` of type `list` and `subplots=True`"
322+
"The length of `title` must equal the number of columns if "
323+
"using `title` of type `list` and `subplots=True`"
324324
)
325325
with pytest.raises(ValueError, match=msg):
326326
df.plot(subplots=True, title=title + ["kittens > puppies"])
@@ -331,8 +331,8 @@ def test_subplot_titles(self, iris):
331331

332332
# Case subplots=False and title is of type list
333333
msg = (
334-
"Using `title` of type `list` is not supported unless"
335-
" `subplots=True` is passed"
334+
"Using `title` of type `list` is not supported unless "
335+
"`subplots=True` is passed"
336336
)
337337
with pytest.raises(ValueError, match=msg):
338338
df.plot(subplots=False, title=title)

pandas/tests/reshape/merge/test_join.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ def test_join_on(self):
212212
source_copy = source.copy()
213213
source_copy["A"] = 0
214214
msg = (
215-
"You are trying to merge on float64 and object columns. If"
216-
" you wish to proceed you should use pd.concat"
215+
"You are trying to merge on float64 and object columns. If "
216+
"you wish to proceed you should use pd.concat"
217217
)
218218
with pytest.raises(ValueError, match=msg):
219219
target.join(source_copy, on="A")

pandas/tests/reshape/merge/test_merge.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ def test_merge_misspecified(self):
201201
merge(self.left, self.right, right_index=True)
202202

203203
msg = (
204-
'Can only pass argument "on" OR "left_on" and "right_on", not'
205-
" a combination of both"
204+
'Can only pass argument "on" OR "left_on" and "right_on", not '
205+
"a combination of both"
206206
)
207207
with pytest.raises(pd.errors.MergeError, match=msg):
208208
merge(self.left, self.left, left_on="key", on="key")
@@ -1013,10 +1013,9 @@ def test_indicator(self):
10131013
df_badcolumn = DataFrame({"col1": [1, 2], i: [2, 2]})
10141014

10151015
msg = (
1016-
"Cannot use `indicator=True` option when data contains a"
1017-
" column named {}|"
1018-
"Cannot use name of an existing column for indicator"
1019-
" column"
1016+
"Cannot use `indicator=True` option when data contains a "
1017+
"column named {}|"
1018+
"Cannot use name of an existing column for indicator column"
10201019
).format(i)
10211020
with pytest.raises(ValueError, match=msg):
10221021
merge(df1, df_badcolumn, on="col1", how="outer", indicator=True)
@@ -1235,8 +1234,8 @@ def test_validation(self):
12351234
)
12361235

12371236
msg = (
1238-
"Merge keys are not unique in either left or right dataset;"
1239-
" not a one-to-one merge"
1237+
"Merge keys are not unique in either left or right dataset; "
1238+
"not a one-to-one merge"
12401239
)
12411240
with pytest.raises(MergeError, match=msg):
12421241
merge(left, right, on="a", validate="1:1")

pandas/tests/reshape/test_concat.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ def test_concatlike_same_dtypes(self):
198198

199199
# cannot append non-index
200200
msg = (
201-
r"cannot concatenate object of type '.+';"
202-
" only Series and DataFrame objs are valid"
201+
r"cannot concatenate object of type '.+'; "
202+
"only Series and DataFrame objs are valid"
203203
)
204204
with pytest.raises(TypeError, match=msg):
205205
pd.Series(vals1).append(vals2)
@@ -1866,8 +1866,8 @@ def test_concat_invalid(self):
18661866
# trying to concat a ndframe with a non-ndframe
18671867
df1 = tm.makeCustomDataframe(10, 2)
18681868
msg = (
1869-
"cannot concatenate object of type '{}';"
1870-
" only Series and DataFrame objs are valid"
1869+
"cannot concatenate object of type '{}'; "
1870+
"only Series and DataFrame objs are valid"
18711871
)
18721872
for obj in [1, dict(), [1, 2], (1, 2)]:
18731873
with pytest.raises(TypeError, match=msg.format(type(obj))):

pandas/tests/test_strings.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -3392,8 +3392,8 @@ def test_encode_decode_errors(self):
33923392
encodeBase = Series(["a", "b", "a\x9d"])
33933393

33943394
msg = (
3395-
r"'charmap' codec can't encode character '\\x9d' in position 1:"
3396-
" character maps to <undefined>"
3395+
r"'charmap' codec can't encode character '\\x9d' in position 1: "
3396+
"character maps to <undefined>"
33973397
)
33983398
with pytest.raises(UnicodeEncodeError, match=msg):
33993399
encodeBase.str.encode("cp1252")
@@ -3406,8 +3406,8 @@ def test_encode_decode_errors(self):
34063406
decodeBase = Series([b"a", b"b", b"a\x9d"])
34073407

34083408
msg = (
3409-
"'charmap' codec can't decode byte 0x9d in position 1:"
3410-
" character maps to <undefined>"
3409+
"'charmap' codec can't decode byte 0x9d in position 1: "
3410+
"character maps to <undefined>"
34113411
)
34123412
with pytest.raises(UnicodeDecodeError, match=msg):
34133413
decodeBase.str.decode("cp1252")

pandas/util/_validators.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ def validate_axis_style_args(data, args, kwargs, arg_name, method_name):
297297
"\n\t'.{method_name}(index=a, columns=b)'.\nUse named "
298298
"arguments to remove any ambiguity. In the future, using "
299299
"positional arguments for 'index' or 'columns' will raise "
300-
" a 'TypeError'."
300+
"a 'TypeError'."
301301
)
302302
warnings.warn(msg.format(method_name=method_name), FutureWarning, stacklevel=4)
303303
out[data._AXIS_NAMES[0]] = args[0]

0 commit comments

Comments
 (0)