Skip to content

CLN: Update old .format to f-string #30547

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 5 commits into from
Dec 30, 2019
Merged
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
11 changes: 5 additions & 6 deletions pandas/core/arrays/boolean.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,9 +755,8 @@ def logical_method(self, other):

if other_is_scalar and not (other is libmissing.NA or lib.is_bool(other)):
raise TypeError(
"'other' should be pandas.NA or a bool. Got {} instead.".format(
type(other).__name__
)
"'other' should be pandas.NA or a bool. "
f"Got {type(other).__name__} instead."
)

if not other_is_scalar and len(self) != len(other):
Expand All @@ -772,7 +771,7 @@ def logical_method(self, other):

return BooleanArray(result, mask)

name = "__{name}__".format(name=op.__name__)
name = f"__{op.__name__}__"
return set_function_name(logical_method, name, cls)

@classmethod
Expand Down Expand Up @@ -819,7 +818,7 @@ def cmp_method(self, other):

return BooleanArray(result, mask, copy=False)

name = "__{name}__".format(name=op.__name__)
name = f"__{op.__name__}"
return set_function_name(cmp_method, name, cls)

def _reduce(self, name, skipna=True, **kwargs):
Expand Down Expand Up @@ -922,7 +921,7 @@ def boolean_arithmetic_method(self, other):

return self._maybe_mask_result(result, mask, other, op_name)

name = "__{name}__".format(name=op_name)
name = f"__{op_name}__"
return set_function_name(boolean_arithmetic_method, name, cls)


Expand Down