File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl
dataframe-jdbc/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/db Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import java.net.URL
1616import java.time.LocalDateTime
1717import java.time.LocalTime
1818import kotlin.reflect.KType
19+ import kotlin.reflect.KVariance
1920import kotlin.reflect.full.isSubtypeOf
2021import kotlin.reflect.jvm.jvmErasure
2122import kotlin.reflect.typeOf
@@ -89,7 +90,12 @@ internal fun renderType(type: KType?): String {
8990 append(name)
9091 if (type.arguments.isNotEmpty()) {
9192 val arguments = type.arguments.joinToString {
92- renderType(it.type)
93+ when (it.variance) {
94+ null -> " *"
95+ KVariance .INVARIANT -> renderType(it.type)
96+ KVariance .IN -> " in ${renderType(it.type)} "
97+ KVariance .OUT -> " out ${renderType(it.type)} "
98+ }
9399 }
94100 append(" <$arguments >" )
95101 }
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ public object DuckDb : DbType("duckdb") {
132132 Map ::class .createType(
133133 listOf (
134134 KTypeProjection .invariant(key.toKType(false )),
135- KTypeProjection .covariant (value.toKType(true )),
135+ KTypeProjection .invariant (value.toKType(true )),
136136 ),
137137 )
138138 }
@@ -141,7 +141,7 @@ public object DuckDb : DbType("duckdb") {
141141 // TODO requires #1266 and #1273 for specific types
142142 // val listType = parseListType(sqlTypeName)
143143 // Array::class.createType(
144- // listOf(KTypeProjection.covariant (listType.toKType(true))),
144+ // listOf(KTypeProjection.invariant (listType.toKType(true))),
145145 // )
146146 typeOf<Array >()
147147 }
You can’t perform that action at this time.
0 commit comments