File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed
core/generated-sources/src
main/kotlin/org/jetbrains/kotlinx/dataframe
test/kotlin/org/jetbrains/kotlinx/dataframe/codeGen Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 11package org.jetbrains.kotlinx.dataframe.codeGen
22
3+ import com.squareup.kotlinpoet.asTypeName
34import org.jetbrains.kotlinx.dataframe.DataFrame
45import org.jetbrains.kotlinx.dataframe.DataRow
56import org.jetbrains.kotlinx.dataframe.annotations.ColumnName
@@ -109,7 +110,11 @@ internal object MarkersExtractor {
109110
110111 else -> {
111112 fieldType = FieldType .ValueFieldType (
112- if (nullableProperties) type.toString().toNullable() else type.toString(),
113+ if (nullableProperties) {
114+ type.asTypeName().toString().toNullable()
115+ } else {
116+ type.asTypeName().toString()
117+ },
113118 )
114119 ColumnSchema .Value (
115120 if (nullableProperties) type.withNullability(true ) else type,
Original file line number Diff line number Diff line change 11package org.jetbrains.kotlinx.dataframe.impl.codeGen
22
3+ import com.squareup.kotlinpoet.asTypeName
34import org.jetbrains.kotlinx.dataframe.codeGen.FieldType
45import org.jetbrains.kotlinx.dataframe.codeGen.GeneratedField
56import org.jetbrains.kotlinx.dataframe.codeGen.Marker
@@ -66,7 +67,7 @@ internal class SchemaProcessorImpl(
6667 fun getFieldType (columnSchema : ColumnSchema ): FieldType =
6768 when (columnSchema) {
6869 is ColumnSchema .Value ->
69- FieldType .ValueFieldType (columnSchema.type.toString())
70+ FieldType .ValueFieldType (columnSchema.type.asTypeName(). toString())
7071
7172 is ColumnSchema .Group ->
7273 FieldType .GroupFieldType (
Original file line number Diff line number Diff line change @@ -61,8 +61,8 @@ internal class ShortNamesRenderingTest : TypeRenderingStrategy by ShortNames {
6161 @Test
6262 fun `short functional types are not supported` () {
6363 fields.keys.asClue {
64- fields[" d" ]!! .renderAccessorFieldType() shouldBe " () -> kotlin.Unit"
65- fields[" d" ]!! .renderFieldType() shouldBe " () -> kotlin.Unit"
64+ fields[" d" ]!! .renderAccessorFieldType() shouldBe " kotlin.Function0<kotlin. Unit> "
65+ fields[" d" ]!! .renderFieldType() shouldBe " kotlin.Function0<kotlin. Unit> "
6666 }
6767 }
6868
@@ -112,7 +112,7 @@ internal class ShortNamesRenderingTest : TypeRenderingStrategy by ShortNames {
112112 @Test
113113 fun `functional type column` () {
114114 fields.keys.asClue {
115- fields[" d" ]!! .renderColumnType() shouldBe " DataColumn<() -> kotlin.Unit>"
115+ fields[" d" ]!! .renderColumnType() shouldBe " DataColumn<kotlin.Function0<kotlin. Unit> >"
116116 }
117117 }
118118
You can’t perform that action at this time.
0 commit comments