Skip to content

Commit dd769e7

Browse files
Fixed bug in #toMarkdown
1 parent 87c45b4 commit dd769e7

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/DataFrame/DataFrame.class.st

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2408,7 +2408,9 @@ DataFrame >> toMarkdown [
24082408

24092409
columnWidths := dataFrame columnNames collect: [ :columnName |
24102410
| maxWidth |
2411-
maxWidth := columnName size.
2411+
columnName isString
2412+
ifFalse: [ maxWidth := columnName asString size ]
2413+
ifTrue: [ maxWidth := columnName size ].
24122414
dataFrame rows do: [ :row |
24132415
| value |
24142416
value := row at: columnName.
@@ -2417,7 +2419,10 @@ DataFrame >> toMarkdown [
24172419

24182420
dataFrame columnNames withIndexDo: [ :columnName :index |
24192421
| paddedColumnName |
2420-
paddedColumnName := columnName padRightTo: (columnWidths at: index).
2422+
paddedColumnName := (columnName isString
2423+
ifFalse: [ columnName asString ]
2424+
ifTrue: [ columnName ]) padRightTo:
2425+
(columnWidths at: index).
24212426
markdown nextPutAll: paddedColumnName , ' | ' ].
24222427
markdown cr.
24232428
markdown nextPutAll: '| '.

0 commit comments

Comments
 (0)