Skip to content

Commit 226b72d

Browse files
author
Alvaro Santiesteban
committed
Test for repr
1 parent 39531c1 commit 226b72d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pandas/io/formats/format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1703,7 +1703,7 @@ def _formatter(x):
17031703
x = Timedelta(x)
17041704
result = x._repr_base(format=format)
17051705
if box:
1706-
result = repr(result)
1706+
result = f"'{result}'"
17071707
return result
17081708

17091709
return _formatter

pandas/io/formats/printing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def as_escaped_string(
229229
max_seq_items=max_seq_items,
230230
)
231231
elif isinstance(thing, str) and quote_strings:
232-
result = repr(as_escaped_string(thing))
232+
result = f"'{as_escaped_string(thing)}'"
233233
else:
234234
result = as_escaped_string(thing)
235235

0 commit comments

Comments
 (0)