File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -433,6 +433,21 @@ DataFrameTest >> testAsDataFrame [
433433 self assert: actual equals: expected
434434]
435435
436+ { #category : #tests }
437+ DataFrameTest >> testAsDataFrameDataTypes [
438+
439+ | actual expected |
440+ actual := #( #( a 1 3.1 )
441+ #( b 2 6.5 )
442+ #( c 3 9.7 ) ) asDataFrame dataTypes.
443+ expected := Dictionary newFrom: {
444+ (1 - > Object ).
445+ (2 - > SmallInteger ).
446+ (3 - > SmallFloat64 ) }.
447+
448+ self assert: actual equals: expected
449+ ]
450+
436451{ #category : #tests }
437452DataFrameTest >> testAsDataFrameEmpty [
438453
Original file line number Diff line number Diff line change @@ -23,7 +23,10 @@ Collection >> asDataFrame [
2323 | value |
2424 value := row at: colIndex ifAbsent: [ nil ].
2525 dataFrame at: rowIndex at: colIndex put: value ] ].
26-
26+ 1 to: numberOfColumns do: [ :colIndex |
27+ dataFrame dataTypes
28+ at: colIndex
29+ put: (dataFrame columnAt: colIndex) calculateDataType ].
2730
2831 ^ dataFrame
2932]
You can’t perform that action at this time.
0 commit comments