Skip to content

Commit c676732

Browse files
author
MomIsBestFriend
committed
F-strings and repr
1 parent eaceb57 commit c676732

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

pandas/tests/tseries/offsets/test_offsets.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4169,7 +4169,7 @@ def _test_offset(self, offset_name, offset_n, tstart, expected_utc_offset):
41694169

41704170
def _make_timestamp(self, string, hrs_offset, tz):
41714171
if hrs_offset >= 0:
4172-
offset_string = f"{hrs_offset:02}00"
4172+
offset_string = f"{hrs_offset:02d}00"
41734173
else:
41744174
offset_string = f"-{(hrs_offset * -1):02}00"
41754175
return Timestamp(string + offset_string).tz_convert(tz)

pandas/util/_decorators.py

+12-7
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,18 @@ def wrapper(*args, **kwargs) -> Callable[..., Any]:
8484
if empty1 or empty2 and not summary:
8585
raise AssertionError(doc_error_msg)
8686
wrapper.__doc__ = dedent(
87-
f"""
88-
{summary.strip()}
89-
90-
.. deprecated:: {version}
91-
{msg}
92-
93-
{dedent(doc)}"""
87+
"""
88+
{summary}
89+
90+
.. deprecated:: {depr_version}
91+
{depr_msg}
92+
93+
{rest_of_docstring}"""
94+
).format(
95+
summary=summary.strip(),
96+
depr_version=version,
97+
depr_msg=msg,
98+
rest_of_docstring=dedent(doc),
9499
)
95100

96101
return wrapper

0 commit comments

Comments
 (0)