Skip to content

Commit 5aced4a

Browse files
committed
linting fixes in parse.kt
1 parent 537bf9c commit 5aced4a

File tree

1 file changed

+12
-8
lines changed
  • core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api

1 file changed

+12
-8
lines changed

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/parse.kt

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ import org.jetbrains.kotlinx.dataframe.api.isColumnGroup
2525
import org.jetbrains.kotlinx.dataframe.api.isFrameColumn
2626
import org.jetbrains.kotlinx.dataframe.api.isSubtypeOf
2727
import org.jetbrains.kotlinx.dataframe.api.map
28-
import org.jetbrains.kotlinx.dataframe.api.parse
2928
import org.jetbrains.kotlinx.dataframe.api.to
30-
import org.jetbrains.kotlinx.dataframe.api.tryParse
3129
import org.jetbrains.kotlinx.dataframe.columns.TypeSuggestion
3230
import org.jetbrains.kotlinx.dataframe.columns.size
3331
import org.jetbrains.kotlinx.dataframe.exceptions.TypeConversionException
@@ -537,23 +535,29 @@ internal fun <T> DataFrame<T>.parseImpl(options: ParserOptions?, columns: Column
537535
when {
538536
// when a frame column is requested to be parsed,
539537
// 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+
}
543543
}
544544
}
545545

546546
// when a column group is requested to be parsed,
547547
// parse each column in the group
548-
col.isColumnGroup() ->
548+
col.isColumnGroup() -> {
549549
col.parseImpl(options) { all() }
550550
.asColumnGroup(col.name())
551551
.asDataColumn()
552+
}
552553

553554
// Base case, parse the column if it's a `String?` column
554-
col.isSubtypeOf<String?>() ->
555+
col.isSubtypeOf<String?>() -> {
555556
col.cast<String?>().tryParseImpl(options)
557+
}
556558

557-
else -> col
559+
else -> {
560+
col
561+
}
558562
}
559563
}

0 commit comments

Comments
 (0)