Skip to content

CLN: Replace confusing brackets with backticks #54091

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pandas/core/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,12 +470,12 @@ def isin(comps: ListLike, values: ListLike) -> npt.NDArray[np.bool_]:
if not is_list_like(comps):
raise TypeError(
"only list-like objects are allowed to be passed "
f"to isin(), you passed a [{type(comps).__name__}]"
f"to isin(), you passed a `{type(comps).__name__}`"
)
if not is_list_like(values):
raise TypeError(
"only list-like objects are allowed to be passed "
f"to isin(), you passed a [{type(values).__name__}]"
f"to isin(), you passed a `{type(values).__name__}`"
)

if not isinstance(values, (ABCIndex, ABCSeries, ABCExtensionArray, np.ndarray)):
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -2581,7 +2581,7 @@ def isin(self, values) -> npt.NDArray[np.bool_]:
values_type = type(values).__name__
raise TypeError(
"only list-like objects are allowed to be passed "
f"to isin(), you passed a [{values_type}]"
f"to isin(), you passed a `{values_type}`"
)
values = sanitize_array(values, None, None)
null_mask = np.asarray(isna(values))
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/computation/test_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def test_simple_cmp_ops(self, cmp_op, lhs, rhs, engine, parser):
[
r"only list-like( or dict-like)? objects are allowed to be "
r"passed to (DataFrame\.)?isin\(\), you passed a "
r"(\[|')bool(\]|')",
r"(`|')bool(`|')",
"argument of type 'bool' is not iterable",
]
)
Expand Down Expand Up @@ -203,7 +203,7 @@ def test_compound_invert_op(self, op, lhs, rhs, request, engine, parser):
[
r"only list-like( or dict-like)? objects are allowed to be "
r"passed to (DataFrame\.)?isin\(\), you passed a "
r"(\[|')float(\]|')",
r"(`|')float(`|')",
"argument of type 'float' is not iterable",
]
)
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/series/methods/test_isin.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_isin_with_string_scalar(self):
s = Series(["A", "B", "C", "a", "B", "B", "A", "C"])
msg = (
r"only list-like objects are allowed to be passed to isin\(\), "
r"you passed a \[str\]"
r"you passed a `str`"
)
with pytest.raises(TypeError, match=msg):
s.isin("a")
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/test_algos.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ class TestIsin:
def test_invalid(self):
msg = (
r"only list-like objects are allowed to be passed to isin\(\), "
r"you passed a \[int\]"
r"you passed a `int`"
)
with pytest.raises(TypeError, match=msg):
algos.isin(1, 1)
Expand Down