Skip to content

Commit b7e4558

Browse files
committed
Merge branch 'master' into devcrocod/serialization-patch0
# Conflicts: # core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/json.kt # core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/JupyterHtmlRenderer.kt # core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/io/json.kt # core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/RenderingTests.kt
2 parents 78441dd + 2c4fdfc commit b7e4558

File tree

297 files changed

+41721
-20200
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

297 files changed

+41721
-20200
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: "Validate Gradle Wrapper"
2+
on: [push, pull_request]
3+
4+
jobs:
5+
validation:
6+
name: "Validation"
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: gradle/wrapper-validation-action@v2

.github/workflows/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ env:
1717
ALGOLIA_INDEX_NAME: prod_DATAFRAME_HELP
1818
ALGOLIA_KEY: ${{ secrets.ALGOLIA_KEY }}
1919
CONFIG_JSON_PRODUCT: Dataframe
20-
CONFIG_JSON_VERSION: '0.12'
20+
CONFIG_JSON_VERSION: '0.13'
2121

2222
jobs:
2323
build-job:
@@ -33,15 +33,15 @@ jobs:
3333
apt-get update
3434
apt-get install -y zip
3535
mkdir -p artifacts
36-
- name: Build docs and include sitemap.xml
36+
- name: Build docs # and include sitemap.xml TODO: uncomment when sitemap.xml is available
3737
run: |
3838
export DISPLAY=:99
3939
Xvfb :99 &
4040
/opt/builder/bin/idea.sh helpbuilderinspect -source-dir . -product $PRODUCT --runner github -output-dir artifacts/ || true
4141
test -e artifacts/$ARTIFACT && echo $ARTIFACT exists
42-
cp docs/StardustDocs/sitemap.xml artifacts/sitemap.xml
43-
cd artifacts
44-
zip -r $ARTIFACT sitemap.xml
42+
# cp docs/StardustDocs/sitemap.xml artifacts/sitemap.xml
43+
# cd artifacts
44+
# zip -r $ARTIFACT sitemap.xml
4545
working-directory: ${{ github.workspace }}
4646
- name: Upload modified documentation artifact
4747
uses: actions/upload-artifact@v3

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Default ignored files
22
.idea
33
.gradle
4+
.kotlin
45
build
56
.ipynb_checkpoints

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
# Kotlin Dataframe: typesafe in-memory structured data processing for JVM
1+
# Kotlin DataFrame: typesafe in-memory structured data processing for JVM
22
[![JetBrains incubator project](https://jb.gg/badges/incubator.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
33
[![Kotlin component alpha stability](https://img.shields.io/badge/project-alpha-kotlin.svg?colorA=555555&colorB=DB3683&label=&logo=kotlin&logoColor=ffffff&logoWidth=10)](https://kotlinlang.org/docs/components-stability.html)
4-
[![Kotlin](https://img.shields.io/badge/kotlin-1.8.20-blue.svg?logo=kotlin)](http://kotlinlang.org)
5-
[![Maven Central](https://img.shields.io/maven-central/v/org.jetbrains.kotlinx/dataframe?color=blue&label=Maven%20Central)](https://search.maven.org/artifact/org.jetbrains.kotlinx/dataframe)
4+
[![Kotlin](https://img.shields.io/badge/kotlin-1.9.22-blue.svg?logo=kotlin)](http://kotlinlang.org)
5+
[![Dynamic XML Badge](https://img.shields.io/badge/dynamic/xml?url=https%3A%2F%2Frepo1.maven.org%2Fmaven2%2Forg%2Fjetbrains%2Fkotlinx%2Fdataframe%2Fmaven-metadata.xml&query=%2F%2Fversion%5Bnot%28contains%28text%28%29%2C%22dev%22%29%29%5D%5Blast%28%29%5D&label=Release%20version)](https://search.maven.org/artifact/org.jetbrains.kotlinx/dataframe)
6+
[![Dynamic XML Badge](https://img.shields.io/badge/dynamic/xml?url=https%3A%2F%2Frepo1.maven.org%2Fmaven2%2Forg%2Fjetbrains%2Fkotlinx%2Fdataframe%2Fmaven-metadata.xml&query=%2F%2Fversion%5Bcontains%28text%28%29%2C%22dev%22%29%5D%5Blast%28%29%5D&label=Dev%20version&color=yellow
7+
)](https://search.maven.org/artifact/org.jetbrains.kotlinx/dataframe)
68
[![GitHub License](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)
79
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/Kotlin/dataframe/HEAD)
810

9-
Kotlin Dataframe aims to reconcile Kotlin's static typing with the dynamic nature of data by utilizing both the full power of the Kotlin language and the opportunities provided by intermittent code execution in Jupyter notebooks and REPL.
11+
Kotlin DataFrame aims to reconcile Kotlin's static typing with the dynamic nature of data by utilizing both the full power of the Kotlin language and the opportunities provided by intermittent code execution in Jupyter notebooks and REPL.
1012

1113
* **Hierarchical** — represents hierarchical data structures, such as JSON or a tree of JVM objects.
1214
* **Functional** — data processing pipeline is organized in a chain of `DataFrame` transformation operations. Every operation returns a new instance of `DataFrame` reusing underlying storage wherever it's possible.
@@ -16,7 +18,7 @@ Kotlin Dataframe aims to reconcile Kotlin's static typing with the dynamic natur
1618
* **Interoperable** — convertable with Kotlin data classes and collections.
1719
* **Generic** — can store objects of any type, not only numbers or strings.
1820
* **Typesafe** — on-the-fly generation of extension properties for type safe data access with Kotlin-style care for null safety.
19-
* **Polymorphic** — type compatibility derives from column schema compatibility. You can define a function that requires a special subset of columns in dataframe but doesn't care about other columns.
21+
* **Polymorphic** — type compatibility derives from column schema compatibility. You can define a function that requires a special subset of columns in a dataframe but doesn't care about other columns.
2022

2123
Integrates with [Kotlin kernel for Jupyter](https://github.com/Kotlin/kotlin-jupyter). Inspired by [krangl](https://github.com/holgerbrandl/krangl), Kotlin Collections and [pandas](https://pandas.pydata.org/)
2224

@@ -31,20 +33,20 @@ You could find the following articles there:
3133
* [Full list of all supported operations](https://kotlin.github.io/dataframe/operations.html)
3234
* [Reading from SQL databases](https://kotlin.github.io/dataframe/readsqldatabases.html)
3335
* [Reading/writing from/to different file formats like JSON, CSV, Apache Arrow](https://kotlin.github.io/dataframe/read.html)
34-
* [Joining a few dataframes](https://kotlin.github.io/dataframe/join.html)
36+
* [Joining dataframes](https://kotlin.github.io/dataframe/join.html)
3537
* [GroupBy operation](https://kotlin.github.io/dataframe/groupby.html)
3638
* [Rendering to HTML](https://kotlin.github.io/dataframe/tohtml.html#jupyter-notebooks)
3739

3840
## Setup
3941

4042
```kotlin
41-
implementation("org.jetbrains.kotlinx:dataframe:0.12.1")
43+
implementation("org.jetbrains.kotlinx:dataframe:0.13.1")
4244
```
4345

4446
Optional Gradle plugin for enhanced type safety and schema generation
4547
https://kotlin.github.io/dataframe/schemasgradle.html
4648
```kotlin
47-
id("org.jetbrains.kotlinx.dataframe") version "0.12.1"
49+
id("org.jetbrains.kotlinx.dataframe") version "0.13.1"
4850
```
4951

5052
Check out the [custom setup page](https://kotlin.github.io/dataframe/gettingstartedgradleadvanced.html) if you don't need some of the formats as dependencies,
@@ -69,7 +71,7 @@ df.filter { "stargazers_count"<Int>() > 50 }.print()
6971

7072
Requires Gradle plugin to work
7173
```kotlin
72-
id("org.jetbrains.kotlinx.dataframe") version "0.12.1"
74+
id("org.jetbrains.kotlinx.dataframe") version "0.13.1"
7375
```
7476

7577
Plugin generates extension properties API for provided sample of data. Column names and their types become discoverable in completion.
@@ -97,13 +99,13 @@ fun main() {
9799

98100
## Getting started in Jupyter Notebook / Kotlin Notebook
99101

100-
Install [Kotlin kernel](https://github.com/Kotlin/kotlin-jupyter) for [Jupyter](https://jupyter.org/)
102+
Install the [Kotlin kernel](https://github.com/Kotlin/kotlin-jupyter) for [Jupyter](https://jupyter.org/)
101103

102-
Import stable `dataframe` version into notebook:
104+
Import the stable `dataframe` version into a notebook:
103105
```
104106
%use dataframe
105107
```
106-
or specific version:
108+
or a specific version:
107109
```
108110
%use dataframe(<version>)
109111
```
@@ -203,7 +205,7 @@ clean
203205
}
204206
```
205207

206-
Check it out on [**Datalore**](https://datalore.jetbrains.com/view/notebook/vq5j45KWkYiSQnACA2Ymij) to get a better visual impression of what happens and what the hierarchical DataFrame structure looks like.
208+
Check it out on [**Datalore**](https://datalore.jetbrains.com/view/notebook/vq5j45KWkYiSQnACA2Ymij) to get a better visual impression of what happens and what the hierarchical dataframe structure looks like.
207209

208210
Explore [**more examples here**](examples).
209211

@@ -219,12 +221,12 @@ This table shows the mapping between main library component versions and minimum
219221
| 0.11.1 | 8 | 1.8.20 | 0.11.0-358 | 3.0.0 | 11.0.0 |
220222
| 0.12.0 | 8 | 1.9.0 | 0.11.0-358 | 3.0.0 | 11.0.0 |
221223
| 0.12.1 | 8 | 1.9.0 | 0.11.0-358 | 3.0.0 | 11.0.0 |
222-
224+
| 0.13.1 | 8 | 1.9.22 | 0.12.0-139 | 3.0.0 | 15.0.0 |
223225

224226
## Code of Conduct
225227

226228
This project and the corresponding community are governed by the [JetBrains Open Source and Community Code of Conduct](https://confluence.jetbrains.com/display/ALL/JetBrains+Open+Source+and+Community+Code+of+Conduct). Please make sure you read it.
227229

228230
## License
229231

230-
Kotlin Dataframe is licensed under the [Apache 2.0 License](LICENSE).
232+
Kotlin DataFrame is licensed under the [Apache 2.0 License](LICENSE).

RELEASE_CHECK_LIST.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
1. Run code inspections (fix typos, Kotlin issues, fix code formatting, linter). **RC**
44
2. Write missed KDocs for new APIs. **RC**
5+
3. Update documentation on Kotlin site **RC**
6+
- The overview [page](https://kotlinlang.org/docs/data-analysis-overview.html)
7+
- The Data Analysis subchapter, for example, the [page](https://kotlinlang.org/docs/data-analysis-work-with-data-sources.html)
58
3. Update tutorials according to the latest code changes.
69
4. Update README.MD according last code changes:
710
- update an artifact version.
@@ -23,16 +26,17 @@
2326
- Check on Datalore with a test project (TODO: add link).
2427
- Check for Android with a test project (TODO: add link).
2528
- Check for ServerSide with a test project (TODO: add link).
26-
15. Publish Documentation from [GitHub Action](https://github.com/Kotlin/dataframe/actions/workflows/main.yml)
27-
16. Prepare and publish the Release Notes. **RC**
28-
17. Create a Release from the release tag on GitHub. **RC**
29-
18. Update a KDF version in the [Kotlin Jupyter Descriptor](https://github.com/Kotlin/kotlin-jupyter-libraries/blob/master/dataframe.json). Now the Renovate bot does this.
30-
19. Update the DataFrame version in the `gradle.properties` file for the next release cycle (i.e. 0.10.0 -> 0.11.0)
31-
20. Update deprecated functions in [deprecationMessages.kt](/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/util/deprecationMessages.kt)
29+
15. Run `./gradlew korro` to update the code snippets for the docs.
30+
16. Publish Documentation from [GitHub Action](https://github.com/Kotlin/dataframe/actions/workflows/main.yml)
31+
17. Prepare and publish the Release Notes. **RC**
32+
18. Create a Release from the release tag on GitHub. **RC**
33+
19. Update a KDF version in the [Kotlin Jupyter Descriptor](https://github.com/Kotlin/kotlin-jupyter-libraries/blob/master/dataframe.json). Now the Renovate bot does this.
34+
20. Update the DataFrame version in the `gradle.properties` file for the next release cycle (i.e. 0.10.0 -> 0.11.0)
35+
21. Update deprecated functions in [deprecationMessages.kt](/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/util/deprecationMessages.kt)
3236
such that
3337
- `Level.WARNING` messages are changed to `Level.ERROR`
3438
- `Level.ERROR` messages and their functions are removed.
3539
- Update regions in the file accordingly.
36-
21. Update Notebook examples, both in the project and on Datalore.
40+
22. Update Notebook examples, both in the project and on Datalore.
3741

3842
(Activities that need to be done for **R**elease **C**andidate releases are marked as such)

build.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,11 @@ kotlinPublications {
233233
apache2()
234234
}
235235
developers {
236-
developer("nikitinas", "Anatoly Nikitin", "[email protected]")
236+
developer("koperagen", "Nikita Klimenko", "[email protected]")
237+
developer("Jolanrensen", "Jolan Rensen", "[email protected]")
238+
developer("zaleslaw", "Aleksei Zinovev", "[email protected]")
239+
developer("ermolenkodev", "Nikita Ermolenko", "[email protected]")
240+
developer("nikitinas", "Anatoly Nikitin", "[email protected]")
237241
}
238242
}
239243

core/build.gradle.kts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import nl.jolanrensen.docProcessor.gradle.creatingProcessDocTask
66
import org.gradle.jvm.tasks.Jar
77
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
88
import org.jmailen.gradle.kotlinter.tasks.LintTask
9+
import xyz.ronella.gradle.plugin.simple.git.OSType
910
import xyz.ronella.gradle.plugin.simple.git.task.GitTask
1011

1112
plugins {
@@ -137,7 +138,8 @@ val clearSamplesOutputs by tasks.creating {
137138

138139
doFirst {
139140
delete {
140-
delete(fileTree(File(projectDir, "../docs/StardustDocs/snippets")))
141+
val generatedSnippets = fileTree(file("../docs/StardustDocs/snippets")).exclude("**/manual/**")
142+
delete(generatedSnippets)
141143
}
142144
}
143145
}
@@ -175,10 +177,17 @@ val installGitPreCommitHook by tasks.creating(Copy::class) {
175177
from(File(rootProject.rootDir, "gradle/scripts/pre-commit"))
176178
into(gitHooksDir)
177179
fileMode = 755
180+
181+
// Workaround for https://github.com/Kotlin/dataframe/issues/612
182+
if (OSType.identify() in listOf(OSType.Mac, OSType.Linux)) doLast {
183+
exec {
184+
workingDir(gitHooksDir)
185+
commandLine("chmod", "755", "pre-commit")
186+
}
187+
}
178188
} else {
179189
logger.lifecycle("'.git/hooks' directory not found. Skipping installation of pre-commit hook.")
180190
}
181-
182191
}
183192
tasks.named("assemble") {
184193
dependsOn(installGitPreCommitHook)

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/aggregation/ColumnsForAggregateSelectionDsl.kt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,19 @@ public interface ColumnsForAggregateSelectionDsl<out T> : ColumnsSelectionDsl<T>
1313
ConfiguredAggregateColumn.withDefault(this, defaultValue)
1414

1515
public infix fun <C> SingleColumn<C>.default(defaultValue: C): SingleColumn<C> =
16-
ConfiguredAggregateColumn.withDefault(this, defaultValue).single()
16+
ConfiguredAggregateColumn.withDefault(this, defaultValue)
1717

1818
public fun path(vararg names: String): ColumnPath = ColumnPath(names.asList())
1919

20-
public infix fun <C> ColumnSet<C>.into(name: String): ColumnSet<C> = ConfiguredAggregateColumn.withPath(this, pathOf(name))
20+
public infix fun <C> ColumnSet<C>.into(name: String): ColumnSet<C> =
21+
ConfiguredAggregateColumn.withPath(this, pathOf(name))
2122

2223
public infix fun <C> SingleColumn<C>.into(name: String): SingleColumn<C> =
23-
ConfiguredAggregateColumn.withPath(this, pathOf(name)).single()
24+
ConfiguredAggregateColumn.withPath(this, pathOf(name))
2425

25-
public infix fun <C> ColumnSet<C>.into(path: ColumnPath): ColumnSet<C> = ConfiguredAggregateColumn.withPath(this, path)
26+
public infix fun <C> ColumnSet<C>.into(path: ColumnPath): ColumnSet<C> =
27+
ConfiguredAggregateColumn.withPath(this, path)
2628

2729
public infix fun <C> SingleColumn<C>.into(path: ColumnPath): SingleColumn<C> =
28-
ConfiguredAggregateColumn.withPath(this, path).single()
30+
ConfiguredAggregateColumn.withPath(this, path)
2931
}

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/annotations/ImportDataSchema.kt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,21 @@ public annotation class CsvOptions(
4949
public val delimiter: Char,
5050
)
5151

52+
/**
53+
* An annotation class that represents options for JDBC connection.
54+
*
55+
* @property [user] The username for the JDBC connection. Default value is an empty string.
56+
* If [extractCredFromEnv] is true, the [user] value will be interpreted as key for system environment variable.
57+
* @property [password] The password for the JDBC connection. Default value is an empty string.
58+
* If [extractCredFromEnv] is true, the [password] value will be interpreted as key for system environment variable.
59+
* @property [extractCredFromEnv] Whether to extract the JDBC credentials from environment variables. Default value is false.
60+
* @property [tableName] The name of the table for the JDBC connection. Default value is an empty string.
61+
* @property [sqlQuery] The SQL query to be executed in the JDBC connection. Default value is an empty string.
62+
*/
5263
public annotation class JdbcOptions(
53-
public val user: String = "", // TODO: I'm not sure about the default parameters
54-
public val password: String = "", // TODO: I'm not sure about the default parameters)
64+
public val user: String = "",
65+
public val password: String = "",
66+
public val extractCredFromEnv: Boolean = false,
5567
public val tableName: String = "",
5668
public val sqlQuery: String = ""
5769
)

0 commit comments

Comments
 (0)