Skip to content

Commit 7695fb2

Browse files
Automated commit of generated code
1 parent 1c6e323 commit 7695fb2

File tree

2 files changed

+30
-24
lines changed

2 files changed

+30
-24
lines changed

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/Integration.kt

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ import org.jetbrains.kotlinx.jupyter.api.libraries.JupyterIntegration
5757
import org.jetbrains.kotlinx.jupyter.api.libraries.resources
5858
import kotlin.reflect.KClass
5959
import kotlin.reflect.KProperty
60-
import kotlin.reflect.KType
6160
import kotlin.reflect.full.isSubtypeOf
6261

6362
/** Users will get an error if their Kotlin Jupyter kernel is older than this version. */
@@ -70,29 +69,6 @@ internal class Integration(private val notebook: Notebook, private val options:
7069

7170
val version = options["v"]
7271

73-
private fun KotlinKernelHost.execute(codeWithConverter: CodeWithConverter, argument: String): VariableName? {
74-
val code = codeWithConverter.with(argument)
75-
return if (code.isNotBlank()) {
76-
val result = execute(code)
77-
if (codeWithConverter.hasConverter) {
78-
result.name
79-
} else {
80-
null
81-
}
82-
} else {
83-
null
84-
}
85-
}
86-
87-
private fun KotlinKernelHost.execute(
88-
codeWithConverter: CodeWithConverter,
89-
property: KProperty<*>,
90-
type: KType,
91-
): VariableName? {
92-
val variableName = "(${property.name}${if (property.returnType.isMarkedNullable) "!!" else ""} as $type)"
93-
return execute(codeWithConverter, variableName)
94-
}
95-
9672
private fun KotlinKernelHost.updateImportDataSchemaVariable(
9773
importDataSchema: ImportDataSchema,
9874
property: KProperty<*>,
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package org.jetbrains.kotlinx.dataframe.jupyter
2+
3+
import org.jetbrains.kotlinx.dataframe.codeGen.CodeWithConverter
4+
import org.jetbrains.kotlinx.jupyter.api.KotlinKernelHost
5+
import org.jetbrains.kotlinx.jupyter.api.VariableName
6+
import kotlin.reflect.KProperty
7+
import kotlin.reflect.KType
8+
9+
internal fun KotlinKernelHost.execute(codeWithConverter: CodeWithConverter, argument: String): VariableName? {
10+
val code = codeWithConverter.with(argument)
11+
return if (code.isNotBlank()) {
12+
val result = execute(code)
13+
if (codeWithConverter.hasConverter) {
14+
result.name
15+
} else {
16+
null
17+
}
18+
} else {
19+
null
20+
}
21+
}
22+
23+
internal fun KotlinKernelHost.execute(
24+
codeWithConverter: CodeWithConverter,
25+
property: KProperty<*>,
26+
type: KType,
27+
): VariableName? {
28+
val variableName = "(${property.name}${if (property.returnType.isMarkedNullable) "!!" else ""} as $type)"
29+
return execute(codeWithConverter, variableName)
30+
}

0 commit comments

Comments
 (0)