Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

importDataSchema tests #699

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions dataframe-openapi/src/test/kotlin/OpenApiTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ class OpenApiTests : JupyterReplTestCase() {
if (separatorChar == '\\') it.replace("\\", "\\\\")
else it
}
@Language("kts")
@Language("kt")
val _1 = execRaw(
"""
val ApiGuru = importDataSchema(File("$filePath"))
Expand All @@ -1077,7 +1077,7 @@ class OpenApiTests : JupyterReplTestCase() {

val apiGuruDataTripleQuote = "\"\"\"${apiGuruData.replace("$", "\${'$'}")}\"\"\""

@Language("kts")
@Language("kt")
val _2 = execRaw(
"""
val df = ApiGuru.APIs.readJsonStr($apiGuruDataTripleQuote)
Expand All @@ -1087,7 +1087,7 @@ class OpenApiTests : JupyterReplTestCase() {

println(_2)

@Language("kts")
@Language("kt")
val _3 = execRaw(
"""
df.filter {
Expand All @@ -1097,6 +1097,17 @@ class OpenApiTests : JupyterReplTestCase() {
}
""".trimIndent()
) as AnyFrame

@Language("kt")
val _4 = execRaw(
"""
ApiGuru.APIs.readJsonStr($apiGuruDataTripleQuote).filter {
value.versions.value.any {
(updated ?: added).year >= 2021
}
}
""".trimIndent()
) as AnyFrame
}

private fun String.trimLines(): String = trim().removeSurrounding("\n").lines().joinToString("\n") { it.trim() }
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
ksp = "1.9.23-1.0.20"
kotlinJupyter = "0.12.0-139"
kotlinJupyter = "0.12.0-225"

# TODO Updating requires major changes all across the project
# https://github.com/Kotlin/dataframe/issues/364
Expand Down