@@ -25,9 +25,7 @@ import org.jetbrains.kotlinx.dataframe.api.isColumnGroup
25
25
import org.jetbrains.kotlinx.dataframe.api.isFrameColumn
26
26
import org.jetbrains.kotlinx.dataframe.api.isSubtypeOf
27
27
import org.jetbrains.kotlinx.dataframe.api.map
28
- import org.jetbrains.kotlinx.dataframe.api.parse
29
28
import org.jetbrains.kotlinx.dataframe.api.to
30
- import org.jetbrains.kotlinx.dataframe.api.tryParse
31
29
import org.jetbrains.kotlinx.dataframe.columns.TypeSuggestion
32
30
import org.jetbrains.kotlinx.dataframe.columns.size
33
31
import org.jetbrains.kotlinx.dataframe.exceptions.TypeConversionException
@@ -537,23 +535,29 @@ internal fun <T> DataFrame<T>.parseImpl(options: ParserOptions?, columns: Column
537
535
when {
538
536
// when a frame column is requested to be parsed,
539
537
// parse each value/frame column at any depth inside each DataFrame in the frame column
540
- col.isFrameColumn() -> col.map {
541
- it.parseImpl(options) {
542
- colsAtAnyDepth { ! it.isColumnGroup() }
538
+ col.isFrameColumn() -> {
539
+ col.map {
540
+ it.parseImpl(options) {
541
+ colsAtAnyDepth { ! it.isColumnGroup() }
542
+ }
543
543
}
544
544
}
545
545
546
546
// when a column group is requested to be parsed,
547
547
// parse each column in the group
548
- col.isColumnGroup() ->
548
+ col.isColumnGroup() -> {
549
549
col.parseImpl(options) { all() }
550
550
.asColumnGroup(col.name())
551
551
.asDataColumn()
552
+ }
552
553
553
554
// Base case, parse the column if it's a `String?` column
554
- col.isSubtypeOf<String ?>() ->
555
+ col.isSubtypeOf<String ?>() -> {
555
556
col.cast<String ?>().tryParseImpl(options)
557
+ }
556
558
557
- else -> col
559
+ else -> {
560
+ col
561
+ }
558
562
}
559
563
}
0 commit comments