Skip to content

Commit

Permalink
make render in jupyter use show instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolanrensen committed Apr 10, 2024
1 parent e05feac commit 7fd77be
Showing 1 changed file with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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("")
}


Expand Down

0 comments on commit 7fd77be

Please sign in to comment.