@@ -868,12 +868,14 @@ def _get_gross_column_widths(self) -> Sequence[int]:
868868 body_column_widths = self ._get_body_column_widths ()
869869 return [
870870 max (* widths )
871- for widths in zip (self .header_column_widths , body_column_widths )
871+ for widths in zip (
872+ self .header_column_widths , body_column_widths , strict = False
873+ )
872874 ]
873875
874876 def _get_body_column_widths (self ) -> Sequence [int ]:
875877 """Get widths of table content columns."""
876- strcols : Sequence [Sequence [str ]] = list (zip (* self .strrows ))
878+ strcols : Sequence [Sequence [str ]] = list (zip (* self .strrows , strict = True ))
877879 return [max (len (x ) for x in col ) for col in strcols ]
878880
879881 def _gen_rows (self ) -> Iterator [Sequence [str ]]:
@@ -899,7 +901,9 @@ def add_header_line(self) -> None:
899901 header_line = self .SPACING .join (
900902 [
901903 _put_str (header , col_width )
902- for header , col_width in zip (self .headers , self .gross_column_widths )
904+ for header , col_width in zip (
905+ self .headers , self .gross_column_widths , strict = True
906+ )
903907 ]
904908 )
905909 self ._lines .append (header_line )
@@ -909,7 +913,7 @@ def add_separator_line(self) -> None:
909913 [
910914 _put_str ("-" * header_colwidth , gross_colwidth )
911915 for header_colwidth , gross_colwidth in zip (
912- self .header_column_widths , self .gross_column_widths
916+ self .header_column_widths , self .gross_column_widths , strict = True
913917 )
914918 ]
915919 )
@@ -920,7 +924,9 @@ def add_body_lines(self) -> None:
920924 body_line = self .SPACING .join (
921925 [
922926 _put_str (col , gross_colwidth )
923- for col , gross_colwidth in zip (row , self .gross_column_widths )
927+ for col , gross_colwidth in zip (
928+ row , self .gross_column_widths , strict = True
929+ )
924930 ]
925931 )
926932 self ._lines .append (body_line )
@@ -980,6 +986,7 @@ def _gen_rows_without_counts(self) -> Iterator[Sequence[str]]:
980986 self ._gen_line_numbers (),
981987 self ._gen_columns (),
982988 self ._gen_dtypes (),
989+ strict = True ,
983990 )
984991
985992 def _gen_rows_with_counts (self ) -> Iterator [Sequence [str ]]:
@@ -989,6 +996,7 @@ def _gen_rows_with_counts(self) -> Iterator[Sequence[str]]:
989996 self ._gen_columns (),
990997 self ._gen_non_null_counts (),
991998 self ._gen_dtypes (),
999+ strict = True ,
9921000 )
9931001
9941002 def _gen_line_numbers (self ) -> Iterator [str ]:
@@ -1092,10 +1100,7 @@ def _gen_rows_without_counts(self) -> Iterator[Sequence[str]]:
10921100
10931101 def _gen_rows_with_counts (self ) -> Iterator [Sequence [str ]]:
10941102 """Iterator with string representation of body data with counts."""
1095- yield from zip (
1096- self ._gen_non_null_counts (),
1097- self ._gen_dtypes (),
1098- )
1103+ yield from zip (self ._gen_non_null_counts (), self ._gen_dtypes (), strict = True )
10991104
11001105
11011106def _get_dataframe_dtype_counts (df : DataFrame ) -> Mapping [str , int ]:
0 commit comments