Skip to content

Commit a3ace80

Browse files
committed
BUG-22984 Fix whatsnew and add test
1 parent 9526ec7 commit a3ace80

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

doc/source/whatsnew/v0.24.0.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ Other Enhancements
194194
- :meth:`Index.to_frame` now supports overriding column name(s) (:issue:`22580`).
195195
- New attribute :attr:`__git_version__` will return git commit sha of current build (:issue:`21295`).
196196
- Compatibility with Matplotlib 3.0 (:issue:`22790`).
197-
- Representation of :class:`DataFrame` fills up the terminal window better
198197

199198
.. _whatsnew_0240.api_breaking:
200199

@@ -803,6 +802,7 @@ I/O
803802
- :func:`read_sas()` will correctly parse sas7bdat files with data page types having also bit 7 set (so page type is 128 + 256 = 384) (:issue:`16615`)
804803
- Bug in :meth:`detect_client_encoding` where potential ``IOError`` goes unhandled when importing in a mod_wsgi process due to restricted access to stdout. (:issue:`21552`)
805804
- Bug in :func:`to_string()` that broke column alignment when ``index=False`` and width of first column's values is greater than the width of first column's header (:issue:`16839`, :issue:`13032`)
805+
- Bug in :func:`to_string()` that caused representations of :class:`DataFrame` to not take up the whole window (:issue:`22984`)
806806

807807
Plotting
808808
^^^^^^^^

pandas/tests/io/formats/test_format.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,16 @@ def test_repr_truncates_terminal_size(self):
343343

344344
assert df2.columns[0] in result.split('\n')[0]
345345

346+
# GH 22984 ensure entire window is filled
347+
terminal_size = (80, 24)
348+
df = pd.DataFrame(np.random.rand(1,7))
349+
p1 = mock.patch('pandas.io.formats.console.get_terminal_size',
350+
return_value=terminal_size)
351+
p2 = mock.patch('pandas.io.formats.format.get_terminal_size',
352+
return_value=terminal_size)
353+
with p1, p2:
354+
assert "..." not in str(df)
355+
346356
def test_repr_max_columns_max_rows(self):
347357
term_width, term_height = get_terminal_size()
348358
if term_width < 10 or term_height < 10:

0 commit comments

Comments
 (0)