Skip to content

Commit 81a5b20

Browse files
committed
Upgrade Gradle to 9.0.0, Kotlin to 2.2.20, and Kotlinx DataFrame to 1.0.0-Beta3, while deprecating schema-related features in build scripts and examples to align with updated dependencies. Updated local.properties with database URL.
1 parent dc94936 commit 81a5b20

9 files changed

Lines changed: 119 additions & 69 deletions

build.gradle.kts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import java.util.*
22

33
plugins {
4-
kotlin("jvm") version "2.0.0"
5-
id("org.jetbrains.kotlinx.dataframe") version "1.0.0-Beta2"
4+
kotlin("jvm") version "2.2.20"
5+
id("com.google.devtools.ksp") version "2.2.20-2.0.2"
6+
id("org.jetbrains.kotlinx.dataframe") version "1.0.0-Beta3"
67
}
78

89
group = "org.jetbrains.kotlinx.dataframe.examples"
@@ -13,7 +14,7 @@ repositories {
1314
}
1415

1516
dependencies {
16-
implementation ("org.jetbrains.kotlinx:dataframe:1.0.0-Beta2")
17+
implementation ("org.jetbrains.kotlinx:dataframe:1.0.0-Beta3")
1718
implementation ("org.jetbrains.kotlinx:kandy-lets-plot:0.8.1-dev-67")
1819
implementation ("org.jetbrains.kotlinx:kandy-api:0.8.1-dev-67")
1920
implementation ("org.mariadb.jdbc:mariadb-java-client:3.5.4")
@@ -25,9 +26,9 @@ dependencies {
2526
val props = Properties()
2627
file("local.properties").inputStream().use { props.load(it) }
2728

28-
dataframes {
29+
/*dataframes {
2930
schema {
30-
data = "jdbc:mariadb://localhost:3307/imdb"
31+
data = System.getenv("DB_URL") ?: props.getProperty("db.url")
3132
name = "org.jetbrains.kotlinx.dataframe.examples.jdbc.Actors"
3233
jdbcOptions {
3334
user = props.getProperty("db.user")
@@ -36,7 +37,7 @@ dataframes {
3637
}
3738
}
3839
schema {
39-
data = "jdbc:mariadb://localhost:3307/imdb"
40+
data = System.getenv("DB_URL") ?: props.getProperty("db.url")
4041
name = "org.jetbrains.kotlinx.dataframe.examples.jdbc.TarantinoFilms"
4142
jdbcOptions {
4243
user = System.getenv("DB_USER") ?: props.getProperty("db.user")
@@ -52,11 +53,11 @@ dataframes {
5253
"""
5354
}
5455
}
55-
}
56+
}*/
5657

5758
tasks.test {
5859
useJUnitPlatform()
5960
}
6061
kotlin {
61-
jvmToolchain(11)
62+
jvmToolchain(17)
6263
}

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
kotlin.code.style=official
2+
ksp.useKSP2=false
3+
kotlin.dataframe.add.ksp=false
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

local.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
db.user=root
2-
db.password=pass
2+
db.password=pass
3+
db.url=jdbc:mariadb://localhost:3307/imdb

notebooks/imdb.ipynb

Lines changed: 94 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
{
44
"metadata": {
55
"ExecuteTime": {
6-
"end_time": "2025-07-23T10:26:20.390405100Z",
7-
"start_time": "2025-07-23T10:26:18.466255400Z"
6+
"end_time": "2025-11-12T16:48:27.486355Z",
7+
"start_time": "2025-11-12T16:48:25.809628300Z"
88
}
99
},
1010
"cell_type": "code",
@@ -19,23 +19,23 @@
1919
{
2020
"metadata": {
2121
"ExecuteTime": {
22-
"end_time": "2025-07-23T10:28:12.882637100Z",
23-
"start_time": "2025-07-23T10:28:07.404078500Z"
22+
"end_time": "2025-11-12T16:48:36.702544600Z",
23+
"start_time": "2025-11-12T16:48:27.575123Z"
2424
}
2525
},
2626
"cell_type": "code",
2727
"source": [
2828
"%useLatestDescriptors\n",
29-
"%use dataframe(v=1.0.0-Beta2)"
29+
"%use dataframe(v=1.0.0-Beta3n)"
3030
],
3131
"outputs": [],
32-
"execution_count": 10
32+
"execution_count": 2
3333
},
3434
{
3535
"metadata": {
3636
"ExecuteTime": {
37-
"end_time": "2025-07-23T10:28:15.589467100Z",
38-
"start_time": "2025-07-23T10:28:15.122504500Z"
37+
"end_time": "2025-11-12T16:48:38.036421300Z",
38+
"start_time": "2025-11-12T16:48:37.848922800Z"
3939
}
4040
},
4141
"cell_type": "code",
@@ -53,8 +53,46 @@
5353
"import java.sql.DriverManager\n",
5454
"import java.util.*\n"
5555
],
56-
"outputs": [],
57-
"execution_count": 11
56+
"outputs": [
57+
{
58+
"ename": "org.jetbrains.kotlinx.jupyter.exceptions.ReplCompilerException",
59+
"evalue": "at Cell In[3], line 10, column 40: Unresolved reference: examples",
60+
"output_type": "error",
61+
"traceback": [
62+
"org.jetbrains.kotlinx.jupyter.exceptions.ReplCompilerException: at Cell In[3], line 10, column 40: Unresolved reference: examples",
63+
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.JupyterCompilerImpl.compileSync(JupyterCompilerImpl.kt:151)",
64+
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.InternalEvaluatorImpl.eval(InternalEvaluatorImpl.kt:126)",
65+
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl.execute_L4Nmkdk$lambda$0$0(CellExecutorImpl.kt:80)",
66+
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl.withHost(ReplForJupyterImpl.kt:791)",
67+
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl.execute-L4Nmkdk(CellExecutorImpl.kt:78)",
68+
"\tat org.jetbrains.kotlinx.jupyter.repl.execution.CellExecutor.execute-L4Nmkdk$default(CellExecutor.kt:14)",
69+
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl.evaluateUserCode-wNURfNM(ReplForJupyterImpl.kt:616)",
70+
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl.evalExImpl(ReplForJupyterImpl.kt:474)",
71+
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl.evalEx$lambda$0(ReplForJupyterImpl.kt:468)",
72+
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl.withEvalContext(ReplForJupyterImpl.kt:450)",
73+
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl.evalEx(ReplForJupyterImpl.kt:467)",
74+
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.processExecuteRequest$lambda$0$0$0(IdeCompatibleMessageRequestProcessor.kt:160)",
75+
"\tat org.jetbrains.kotlinx.jupyter.streams.BlockingSubstitutionEngine.withDataSubstitution(SubstitutionEngine.kt:70)",
76+
"\tat org.jetbrains.kotlinx.jupyter.streams.StreamSubstitutionManager.withSubstitutedStreams(StreamSubstitutionManager.kt:118)",
77+
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.withForkedIn(IdeCompatibleMessageRequestProcessor.kt:350)",
78+
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.evalWithIO$lambda$0$0(IdeCompatibleMessageRequestProcessor.kt:363)",
79+
"\tat org.jetbrains.kotlinx.jupyter.streams.BlockingSubstitutionEngine.withDataSubstitution(SubstitutionEngine.kt:70)",
80+
"\tat org.jetbrains.kotlinx.jupyter.streams.StreamSubstitutionManager.withSubstitutedStreams(StreamSubstitutionManager.kt:118)",
81+
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.withForkedErr(IdeCompatibleMessageRequestProcessor.kt:340)",
82+
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.evalWithIO$lambda$0(IdeCompatibleMessageRequestProcessor.kt:362)",
83+
"\tat org.jetbrains.kotlinx.jupyter.streams.BlockingSubstitutionEngine.withDataSubstitution(SubstitutionEngine.kt:70)",
84+
"\tat org.jetbrains.kotlinx.jupyter.streams.StreamSubstitutionManager.withSubstitutedStreams(StreamSubstitutionManager.kt:118)",
85+
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.withForkedOut(IdeCompatibleMessageRequestProcessor.kt:333)",
86+
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.evalWithIO(IdeCompatibleMessageRequestProcessor.kt:361)",
87+
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.processExecuteRequest$lambda$0$0(IdeCompatibleMessageRequestProcessor.kt:159)",
88+
"\tat org.jetbrains.kotlinx.jupyter.execution.JupyterExecutorImpl$Task.execute(JupyterExecutorImpl.kt:41)",
89+
"\tat org.jetbrains.kotlinx.jupyter.execution.JupyterExecutorImpl.executorThread$lambda$0(JupyterExecutorImpl.kt:81)",
90+
"\tat kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:30)",
91+
""
92+
]
93+
}
94+
],
95+
"execution_count": 3
5896
},
5997
{
6098
"cell_type": "markdown",
@@ -83,54 +121,59 @@
83121
"metadata": {
84122
"collapsed": false,
85123
"ExecuteTime": {
86-
"end_time": "2025-07-23T10:28:18.422465500Z",
87-
"start_time": "2025-07-23T10:28:17.769229200Z"
124+
"end_time": "2025-07-23T10:53:53.156547600Z",
125+
"start_time": "2025-07-23T10:53:52.862480Z"
88126
}
89127
},
90128
"outputs": [
91129
{
92-
"name": "stdout",
93-
"output_type": "stream",
94-
"text": [
95-
"--- Schema for Table actors ---\r\n",
96-
"id: Int\n",
97-
"first_name: String?\n",
98-
"last_name: String?\n",
99-
"gender: String?\r\n",
100-
"\r\n",
101-
"--- Schema for Table directors ---\r\n",
102-
"id: Int\n",
103-
"first_name: String?\n",
104-
"last_name: String?\r\n",
105-
"\r\n",
106-
"--- Schema for Table directors_genres ---\r\n",
107-
"director_id: Int\n",
108-
"genre: String\n",
109-
"prob: Float?\r\n",
110-
"\r\n",
111-
"--- Schema for Table movies ---\r\n",
112-
"id: Int\n",
113-
"name: String?\n",
114-
"year: Int?\n",
115-
"rank: Float?\r\n",
116-
"\r\n",
117-
"--- Schema for Table movies_directors ---\r\n",
118-
"director_id: Int\n",
119-
"movie_id: Int\r\n",
120-
"\r\n",
121-
"--- Schema for Table movies_genres ---\r\n",
122-
"movie_id: Int\n",
123-
"genre: String\r\n",
124-
"\r\n",
125-
"--- Schema for Table roles ---\r\n",
126-
"actor_id: Int\n",
127-
"movie_id: Int\n",
128-
"role: String\r\n",
129-
"\r\n"
130+
"ename": "org.jetbrains.kotlinx.jupyter.exceptions.ReplCompilerException",
131+
"evalue": "at Cell In[4], line 1, column 35: Function invocation 'URL(...)' expected\nat Cell In[4], line 1, column 35: None of the following functions can be called with the arguments supplied: \npublic constructor URL(p0: URL!, p1: String!) defined in java.net.URL\npublic constructor URL(p0: URL!, p1: String!, p2: URLStreamHandler!) defined in java.net.URL\npublic constructor URL(p0: String!) defined in java.net.URL\npublic constructor URL(p0: String!, p1: String!, p2: Int, p3: String!) defined in java.net.URL\npublic constructor URL(p0: String!, p1: String!, p2: Int, p3: String!, p4: URLStreamHandler!) defined in java.net.URL\npublic constructor URL(p0: String!, p1: String!, p2: String!) defined in java.net.URL\nat Cell In[4], line 1, column 40: Unresolved reference: USER_NAME\nat Cell In[4], line 1, column 51: Unresolved reference: PASSWORD",
132+
"output_type": "error",
133+
"traceback": [
134+
"org.jetbrains.kotlinx.jupyter.exceptions.ReplCompilerException: at Cell In[4], line 1, column 35: Function invocation 'URL(...)' expected",
135+
"at Cell In[4], line 1, column 35: None of the following functions can be called with the arguments supplied: ",
136+
"public constructor URL(p0: URL!, p1: String!) defined in java.net.URL",
137+
"public constructor URL(p0: URL!, p1: String!, p2: URLStreamHandler!) defined in java.net.URL",
138+
"public constructor URL(p0: String!) defined in java.net.URL",
139+
"public constructor URL(p0: String!, p1: String!, p2: Int, p3: String!) defined in java.net.URL",
140+
"public constructor URL(p0: String!, p1: String!, p2: Int, p3: String!, p4: URLStreamHandler!) defined in java.net.URL",
141+
"public constructor URL(p0: String!, p1: String!, p2: String!) defined in java.net.URL",
142+
"at Cell In[4], line 1, column 40: Unresolved reference: USER_NAME",
143+
"at Cell In[4], line 1, column 51: Unresolved reference: PASSWORD",
144+
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.JupyterCompilerImpl.compileSync(JupyterCompilerImpl.kt:152)",
145+
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.InternalEvaluatorImpl.eval(InternalEvaluatorImpl.kt:127)",
146+
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl.execute_L4Nmkdk$lambda$9$lambda$1(CellExecutorImpl.kt:80)",
147+
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl.withHost(ReplForJupyterImpl.kt:794)",
148+
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl.execute-L4Nmkdk(CellExecutorImpl.kt:78)",
149+
"\tat org.jetbrains.kotlinx.jupyter.repl.execution.CellExecutor.execute-L4Nmkdk$default(CellExecutor.kt:14)",
150+
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl.evaluateUserCode-wNURfNM(ReplForJupyterImpl.kt:616)",
151+
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl.evalExImpl(ReplForJupyterImpl.kt:474)",
152+
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl.evalEx$lambda$20(ReplForJupyterImpl.kt:467)",
153+
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl.withEvalContext(ReplForJupyterImpl.kt:447)",
154+
"\tat org.jetbrains.kotlinx.jupyter.repl.impl.ReplForJupyterImpl.evalEx(ReplForJupyterImpl.kt:466)",
155+
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.processExecuteRequest$lambda$7$lambda$6$lambda$5(IdeCompatibleMessageRequestProcessor.kt:160)",
156+
"\tat org.jetbrains.kotlinx.jupyter.streams.BlockingSubstitutionEngine.withDataSubstitution(SubstitutionEngine.kt:70)",
157+
"\tat org.jetbrains.kotlinx.jupyter.streams.StreamSubstitutionManager.withSubstitutedStreams(StreamSubstitutionManager.kt:118)",
158+
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.withForkedIn(IdeCompatibleMessageRequestProcessor.kt:354)",
159+
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.evalWithIO$lambda$16$lambda$15(IdeCompatibleMessageRequestProcessor.kt:368)",
160+
"\tat org.jetbrains.kotlinx.jupyter.streams.BlockingSubstitutionEngine.withDataSubstitution(SubstitutionEngine.kt:70)",
161+
"\tat org.jetbrains.kotlinx.jupyter.streams.StreamSubstitutionManager.withSubstitutedStreams(StreamSubstitutionManager.kt:118)",
162+
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.withForkedErr(IdeCompatibleMessageRequestProcessor.kt:343)",
163+
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.evalWithIO$lambda$16(IdeCompatibleMessageRequestProcessor.kt:367)",
164+
"\tat org.jetbrains.kotlinx.jupyter.streams.BlockingSubstitutionEngine.withDataSubstitution(SubstitutionEngine.kt:70)",
165+
"\tat org.jetbrains.kotlinx.jupyter.streams.StreamSubstitutionManager.withSubstitutedStreams(StreamSubstitutionManager.kt:118)",
166+
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.withForkedOut(IdeCompatibleMessageRequestProcessor.kt:335)",
167+
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.evalWithIO(IdeCompatibleMessageRequestProcessor.kt:366)",
168+
"\tat org.jetbrains.kotlinx.jupyter.messaging.IdeCompatibleMessageRequestProcessor.processExecuteRequest$lambda$7$lambda$6(IdeCompatibleMessageRequestProcessor.kt:159)",
169+
"\tat org.jetbrains.kotlinx.jupyter.execution.JupyterExecutorImpl$Task.execute(JupyterExecutorImpl.kt:41)",
170+
"\tat org.jetbrains.kotlinx.jupyter.execution.JupyterExecutorImpl.executorThread$lambda$0(JupyterExecutorImpl.kt:83)",
171+
"\tat kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:30)",
172+
""
130173
]
131174
}
132175
],
133-
"execution_count": 12
176+
"execution_count": 4
134177
},
135178
{
136179
"cell_type": "markdown",

src/main/kotlin/Example_1_Define_schema_manually.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@ import org.jetbrains.kotlinx.dataframe.api.cast
88
import org.jetbrains.kotlinx.dataframe.api.sortByDesc
99
import org.jetbrains.kotlinx.dataframe.api.print
1010
import org.jetbrains.kotlinx.dataframe.api.take
11+
import org.jetbrains.kotlinx.dataframe.api.generateInterfaces
1112
import org.jetbrains.kotlinx.dataframe.io.readSqlTable
1213
import org.jetbrains.kotlinx.dataframe.io.DbConnectionConfig
1314

1415
@DataSchema
1516
interface Movies {
1617
val id: Int
1718
val name: String
18-
val year: Int
1919
val rank: Float?
20+
val year: Int
2021
}
2122

2223
fun main() {
@@ -32,9 +33,11 @@ fun main() {
3233
// print the dataframe metadata and statistics
3334
movies.describe().print()
3435

36+
print(movies.generateInterfaces("Movies"))
37+
3538
// print names of top-10 rated films
36-
movies.sortByDesc { rank }
39+
/*movies.sortByDesc { rank }
3740
.take(10)
3841
.select { name }
39-
.print()
42+
.print()*/
4043
}

src/main/kotlin/Example_2_Import_schema_annotation.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@file:ImportDataSchema(
1+
/*@file:ImportDataSchema(
22
"Directors",
33
URL,
44
jdbcOptions = JdbcOptions(USER_NAME, PASSWORD, tableName = TABLE_NAME_DIRECTORS)
@@ -49,4 +49,4 @@ fun main() {
4949
newActors.groupBy { role }
5050
.count()
5151
.print()
52-
}
52+
}*/

src/main/kotlin/Example_3_Import_schema_via_Gradle.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.jetbrains.kotlinx.dataframe.examples.jdbc
1+
/*package org.jetbrains.kotlinx.dataframe.examples.jdbc
22
33
import java.sql.DriverManager
44
import java.util.Properties
@@ -99,4 +99,4 @@ fun main() {
9999
it.describe()
100100
}
101101
}
102-
}
102+
}*/

src/main/kotlin/customdb/Example_1_Define_schema_manually.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fun main() {
2525
.renameToCamelCase()
2626
.cast<Orders>(verify = true)
2727

28-
df.filter { it.price > 800 }.print()
28+
// df.filter { it.price > 800 }.print()
2929

3030
removeTable(con)
3131
}

0 commit comments

Comments
 (0)