From b837cb30c1596a5d3ced0155a3dfb498dc251716 Mon Sep 17 00:00:00 2001 From: Simon Hawkins Date: Thu, 10 Oct 2019 22:32:44 +0100 Subject: [PATCH] TYPING: fix type annotation for pandas.io.formats.format._binify --- pandas/io/formats/format.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandas/io/formats/format.py b/pandas/io/formats/format.py index 15f21814b072d..ad62c56a337b6 100644 --- a/pandas/io/formats/format.py +++ b/pandas/io/formats/format.py @@ -868,6 +868,8 @@ def _join_multiline(self, *args) -> str: np.array([self.adj.len(x) for x in col]).max() if len(col) > 0 else 0 for col in strcols ] + + assert lwidth is not None col_bins = _binify(col_widths, lwidth) nbins = len(col_bins) @@ -1890,7 +1892,7 @@ def set_eng_float_format(accuracy: int = 3, use_eng_prefix: bool = False) -> Non set_option("display.column_space", max(12, accuracy + 9)) -def _binify(cols: List[np.int32], line_width: Union[np.int32, int]) -> List[int]: +def _binify(cols: List[int], line_width: int) -> List[int]: adjoin_width = 1 bins = [] curr_width = 0