From 7fd77bedf0e00f04dc2adef1a42fc9ab469ffc53 Mon Sep 17 00:00:00 2001 From: Jolan Rensen Date: Wed, 10 Apr 2024 12:49:54 +0200 Subject: [PATCH] make render in jupyter use show instead --- .../kotlinx/spark/api/jupyter/Integration.kt | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/jupyter/src/main/kotlin/org/jetbrains/kotlinx/spark/api/jupyter/Integration.kt b/jupyter/src/main/kotlin/org/jetbrains/kotlinx/spark/api/jupyter/Integration.kt index 6e2585dc..715fa94a 100644 --- a/jupyter/src/main/kotlin/org/jetbrains/kotlinx/spark/api/jupyter/Integration.kt +++ b/jupyter/src/main/kotlin/org/jetbrains/kotlinx/spark/api/jupyter/Integration.kt @@ -240,19 +240,23 @@ abstract class Integration(private val notebook: Notebook, private val options: private fun renderDataset(it: Dataset<*>): MimeTypedResult = with(properties) { - val showFunction = Dataset::class - .memberFunctions - .firstOrNull { it.name == "showString" && it.valueParameters.size == 3 } - - textResult( - if (showFunction != null) { - showFunction.call(it, displayLimit, displayTruncate, false) as String - } else { - // if the function cannot be called, make sure it will call println instead - it.show(displayLimit, displayTruncate) - "" - } - ) +// val showFunction = Dataset::class +// .memberFunctions +// .firstOrNull { it.name == "showString" && it.valueParameters.size == 3 } +// +// textResult( +// if (showFunction != null) { +// showFunction.call(it, displayLimit, displayTruncate, false) as String +// } else { +// // if the function cannot be called, make sure it will call println instead +// it.show(displayLimit, displayTruncate) +// "" +// } +// ) + + // don't actually render, instead use `show()`, which calls System.out + it.show(displayLimit, displayTruncate) + textResult("") }