Skip to content

Commit 448153d

Browse files
committed
BUG-22984 Fix whatsnew and add test
1 parent 8e82c82 commit 448153d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

doc/source/whatsnew/v0.24.0.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,8 +1273,12 @@ Notice how we now instead output ``np.nan`` itself instead of a stringified form
12731273
- :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`)
12741274
- 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`)
12751275
- 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`)
1276+
<<<<<<< HEAD
12761277
- Bug in :func:`DataFrame.to_csv` where a single level MultiIndex incorrectly wrote a tuple. Now just the value of the index is written (:issue:`19589`).
12771278
- Bug in :meth:`HDFStore.append` when appending a :class:`DataFrame` with an empty string column and ``min_itemsize`` < 8 (:issue:`12242`)
1279+
=======
1280+
- Bug in :func:`to_string()` that caused representations of :class:`DataFrame` to not take up the whole window (:issue:`22984`)
1281+
>>>>>>> a3ace8012... BUG-22984 Fix whatsnew and add test
12781282

12791283
Plotting
12801284
^^^^^^^^

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)