@@ -793,19 +793,16 @@ def _truncate_vertically(self) -> None:
793
793
self .tr_row_num = row_num
794
794
795
795
def _get_strcols_without_index (self ) -> List [List [str ]]:
796
- # TODO check this comment validity
797
- # this method is not used by to_html where self.col_space
798
- # could be a string so safe to cast
799
- col_space = {k : cast (int , v ) for k , v in self .col_space .items ()}
800
-
801
- frame = self .tr_frame
802
796
strcols : List [List [str ]] = []
803
797
804
798
if not is_list_like (self .header ) and not self .header :
805
- for i , c in enumerate (frame ):
799
+ for i , c in enumerate (self . tr_frame ):
806
800
fmt_values = self ._format_col (i )
807
801
fmt_values = _make_fixed_width (
808
- fmt_values , self .justify , minimum = col_space .get (c , 0 ), adj = self .adj
802
+ strings = fmt_values ,
803
+ justify = self .justify ,
804
+ minimum = int (self .col_space .get (c , 0 )),
805
+ adj = self .adj ,
809
806
)
810
807
strcols .append (fmt_values )
811
808
return strcols
@@ -820,16 +817,16 @@ def _get_strcols_without_index(self) -> List[List[str]]:
820
817
)
821
818
str_columns = [[label ] for label in self .header ]
822
819
else :
823
- str_columns = self ._get_formatted_column_labels (frame )
820
+ str_columns = self ._get_formatted_column_labels (self . tr_frame )
824
821
825
822
if self .show_row_idx_names :
826
823
for x in str_columns :
827
824
x .append ("" )
828
825
829
- for i , c in enumerate (frame ):
826
+ for i , c in enumerate (self . tr_frame ):
830
827
cheader = str_columns [i ]
831
828
header_colwidth = max (
832
- col_space .get (c , 0 ), * (self .adj .len (x ) for x in cheader )
829
+ int ( self . col_space .get (c , 0 ) ), * (self .adj .len (x ) for x in cheader )
833
830
)
834
831
fmt_values = self ._format_col (i )
835
832
fmt_values = _make_fixed_width (
0 commit comments