Skip to content

Commit

Permalink
F-strings and repr
Browse files Browse the repository at this point in the history
  • Loading branch information
MomIsBestFriend committed Nov 30, 2019
1 parent eaceb57 commit c676732
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pandas/tests/tseries/offsets/test_offsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -4169,7 +4169,7 @@ def _test_offset(self, offset_name, offset_n, tstart, expected_utc_offset):

def _make_timestamp(self, string, hrs_offset, tz):
if hrs_offset >= 0:
offset_string = f"{hrs_offset:02}00"
offset_string = f"{hrs_offset:02d}00"
else:
offset_string = f"-{(hrs_offset * -1):02}00"
return Timestamp(string + offset_string).tz_convert(tz)
Expand Down
19 changes: 12 additions & 7 deletions pandas/util/_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,18 @@ def wrapper(*args, **kwargs) -> Callable[..., Any]:
if empty1 or empty2 and not summary:
raise AssertionError(doc_error_msg)
wrapper.__doc__ = dedent(
f"""
{summary.strip()}
.. deprecated:: {version}
{msg}
{dedent(doc)}"""
"""
{summary}
.. deprecated:: {depr_version}
{depr_msg}
{rest_of_docstring}"""
).format(
summary=summary.strip(),
depr_version=version,
depr_msg=msg,
rest_of_docstring=dedent(doc),
)

return wrapper
Expand Down

0 comments on commit c676732

Please sign in to comment.