Skip to content

Commit

Permalink
STY: wrong placed space in strings (#30940)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaharNaveh authored and jbrockmendel committed Jan 12, 2020
1 parent 28e909c commit 4e2546d
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 36 deletions.
4 changes: 2 additions & 2 deletions pandas/tests/frame/test_missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,8 @@ def test_fillna_invalid_value(self, float_frame):
float_frame.fillna((1, 2))
# frame with series
msg = (
'"value" parameter must be a scalar, dict or Series, but you'
' passed a "DataFrame"'
'"value" parameter must be a scalar, dict or Series, but you '
'passed a "DataFrame"'
)
with pytest.raises(TypeError, match=msg):
float_frame.iloc[:, 0].fillna(float_frame)
Expand Down
6 changes: 3 additions & 3 deletions pandas/tests/frame/test_repr_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,13 @@ def test_repr_column_name_unicode_truncation_bug(self):
"Id": [7117434],
"StringCol": (
"Is it possible to modify drop plot code"
" so that the output graph is displayed "
"so that the output graph is displayed "
"in iphone simulator, Is it possible to "
"modify drop plot code so that the "
"output graph is \xe2\x80\xa8displayed "
"in iphone simulator.Now we are adding "
"the CSV file externally. I want to Call"
" the File through the code.."
"the CSV file externally. I want to Call "
"the File through the code.."
),
}
)
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/frame/test_reshape.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ def test_stack_mixed_levels(self):
# When mixed types are passed and the ints are not level
# names, raise
msg = (
"level should contain all level names or all level numbers, not"
" a mixture of the two"
"level should contain all level names or all level numbers, not "
"a mixture of the two"
)
with pytest.raises(ValueError, match=msg):
df2.stack(level=["animal", 0])
Expand Down
5 changes: 1 addition & 4 deletions pandas/tests/groupby/test_grouping.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,10 +725,7 @@ def test_get_group(self):
g.get_group("foo")
with pytest.raises(ValueError, match=msg):
g.get_group(("foo"))
msg = (
"must supply a same-length tuple to get_group with multiple"
" grouping keys"
)
msg = "must supply a same-length tuple to get_group with multiple grouping keys"
with pytest.raises(ValueError, match=msg):
g.get_group(("foo", "bar", "baz"))

Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/plotting/test_datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ def test_both_style_and_color(self):
ts = tm.makeTimeSeries()
msg = (
"Cannot pass 'style' string with a color symbol and 'color' "
"keyword argument. Please use one or the other or pass 'style'"
" without a color symbol"
"keyword argument. Please use one or the other or pass 'style' "
"without a color symbol"
)
with pytest.raises(ValueError, match=msg):
ts.plot(style="b-", color="#000099")
Expand Down
8 changes: 4 additions & 4 deletions pandas/tests/plotting/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@ def test_subplot_titles(self, iris):

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

# Case subplots=False and title is of type list
msg = (
"Using `title` of type `list` is not supported unless"
" `subplots=True` is passed"
"Using `title` of type `list` is not supported unless "
"`subplots=True` is passed"
)
with pytest.raises(ValueError, match=msg):
df.plot(subplots=False, title=title)
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/reshape/merge/test_join.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ def test_join_on(self):
source_copy = source.copy()
source_copy["A"] = 0
msg = (
"You are trying to merge on float64 and object columns. If"
" you wish to proceed you should use pd.concat"
"You are trying to merge on float64 and object columns. If "
"you wish to proceed you should use pd.concat"
)
with pytest.raises(ValueError, match=msg):
target.join(source_copy, on="A")
Expand Down
15 changes: 7 additions & 8 deletions pandas/tests/reshape/merge/test_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ def test_merge_misspecified(self):
merge(self.left, self.right, right_index=True)

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

msg = (
"Cannot use `indicator=True` option when data contains a"
" column named {}|"
"Cannot use name of an existing column for indicator"
" column"
"Cannot use `indicator=True` option when data contains a "
"column named {}|"
"Cannot use name of an existing column for indicator column"
).format(i)
with pytest.raises(ValueError, match=msg):
merge(df1, df_badcolumn, on="col1", how="outer", indicator=True)
Expand Down Expand Up @@ -1235,8 +1234,8 @@ def test_validation(self):
)

msg = (
"Merge keys are not unique in either left or right dataset;"
" not a one-to-one merge"
"Merge keys are not unique in either left or right dataset; "
"not a one-to-one merge"
)
with pytest.raises(MergeError, match=msg):
merge(left, right, on="a", validate="1:1")
Expand Down
8 changes: 4 additions & 4 deletions pandas/tests/reshape/test_concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ def test_concatlike_same_dtypes(self):

# cannot append non-index
msg = (
r"cannot concatenate object of type '.+';"
" only Series and DataFrame objs are valid"
r"cannot concatenate object of type '.+'; "
"only Series and DataFrame objs are valid"
)
with pytest.raises(TypeError, match=msg):
pd.Series(vals1).append(vals2)
Expand Down Expand Up @@ -1866,8 +1866,8 @@ def test_concat_invalid(self):
# trying to concat a ndframe with a non-ndframe
df1 = tm.makeCustomDataframe(10, 2)
msg = (
"cannot concatenate object of type '{}';"
" only Series and DataFrame objs are valid"
"cannot concatenate object of type '{}'; "
"only Series and DataFrame objs are valid"
)
for obj in [1, dict(), [1, 2], (1, 2)]:
with pytest.raises(TypeError, match=msg.format(type(obj))):
Expand Down
8 changes: 4 additions & 4 deletions pandas/tests/test_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3392,8 +3392,8 @@ def test_encode_decode_errors(self):
encodeBase = Series(["a", "b", "a\x9d"])

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

msg = (
"'charmap' codec can't decode byte 0x9d in position 1:"
" character maps to <undefined>"
"'charmap' codec can't decode byte 0x9d in position 1: "
"character maps to <undefined>"
)
with pytest.raises(UnicodeDecodeError, match=msg):
decodeBase.str.decode("cp1252")
Expand Down
2 changes: 1 addition & 1 deletion pandas/util/_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def validate_axis_style_args(data, args, kwargs, arg_name, method_name):
"\n\t'.{method_name}(index=a, columns=b)'.\nUse named "
"arguments to remove any ambiguity. In the future, using "
"positional arguments for 'index' or 'columns' will raise "
" a 'TypeError'."
"a 'TypeError'."
)
warnings.warn(msg.format(method_name=method_name), FutureWarning, stacklevel=4)
out[data._AXIS_NAMES[0]] = args[0]
Expand Down

0 comments on commit 4e2546d

Please sign in to comment.