Skip to content
This repository was archived by the owner on Jan 28, 2023. It is now read-only.

Commit c249359

Browse files
committed
v0.18.1 release
1 parent 29d3ce1 commit c249359

File tree

5 files changed

+42
-10
lines changed

5 files changed

+42
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# krangl
22

3-
[ ![Download](https://img.shields.io/badge/Maven%20Central-0.18-orange) ](https://mvnrepository.com/artifact/com.github.holgerbrandl/krangl) [![Build Status](https://github.com/holgerbrandl/krangl/workflows/build/badge.svg)](https://github.com/holgerbrandl/krangl/actions?query=workflow%3Abuild) [![Gitter](https://badges.gitter.im/holgerbrandl/krangl.svg)](https://gitter.im/holgerbrandl/krangl?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
3+
[ ![Download](https://img.shields.io/badge/Maven%20Central-0.18.1-orange) ](https://mvnrepository.com/artifact/com.github.holgerbrandl/krangl) [![Build Status](https://github.com/holgerbrandl/krangl/workflows/build/badge.svg)](https://github.com/holgerbrandl/krangl/actions?query=workflow%3Abuild) [![Gitter](https://badges.gitter.im/holgerbrandl/krangl.svg)](https://gitter.im/holgerbrandl/krangl?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
44

55
`krangl` is a {K}otlin library for data w{rangl}ing. By implementing a grammar of data manipulation using a modern functional-style API, it allows to filter, transform, aggregate and reshape tabular data.
66

@@ -32,7 +32,7 @@ repositories {
3232
}
3333
3434
dependencies {
35-
implementation "com.github.holgerbrandl:krangl:0.18"
35+
implementation "com.github.holgerbrandl:krangl:0.18.1"
3636
}
3737
```
3838
Declaring the repository is purely optional as it is the default already.

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
plugins {
3-
id "org.jetbrains.kotlin.jvm" version "1.6.20"
3+
id "org.jetbrains.kotlin.jvm" version "1.7.0"
44
id "java"
55
id "maven-publish"
66
id "signing"
@@ -35,9 +35,9 @@ dependencies {
3535
// implementation 'org.jetbrains.kotlinx:dataframe:0.8.0-rc-7'
3636
// testImplementation 'org.jetbrains.kotlinx:dataframe:0.8.0-rc-7'
3737

38-
testImplementation group: 'junit', name: 'junit', version: '4.12'
38+
testImplementation group: 'junit', name: 'junit', version: '4.13.1'
3939
testImplementation('io.kotest:kotest-assertions-core:5.2.2')
40-
testImplementation 'com.h2database:h2:2.1.210'
40+
testImplementation 'com.h2database:h2:2.1.212'
4141
testImplementation 'org.jetbrains.kotlin:kotlin-script-runtime:1.6.10'
4242
}
4343

@@ -100,7 +100,7 @@ test {
100100
//http://stackoverflow.com/questions/34377367/why-is-gradle-install-replacing-my-version-with-unspecified
101101
group 'com.github.holgerbrandl'
102102
//version '0.16.95'
103-
version '0.18'
103+
version '0.18.1'
104104

105105

106106

docs/userguide/docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[ ![Download](https://img.shields.io/badge/Maven%20Central-0.18-orange) ](https://mvnrepository.com/artifact/com.github.holgerbrandl.krangl/krangl) [![Build Status](https://github.com/holgerbrandl/krangl/workflows/build/badge.svg)](https://github.com/holgerbrandl/krangl/actions?query=workflow%3Abuild) [![Gitter](https://badges.gitter.im/holgerbrandl/krangl.svg)](https://gitter.im/holgerbrandl/krangl?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
1+
[ ![Download](https://img.shields.io/badge/Maven%20Central-0.18.1-orange) ](https://mvnrepository.com/artifact/com.github.holgerbrandl.krangl/krangl) [![Build Status](https://github.com/holgerbrandl/krangl/workflows/build/badge.svg)](https://github.com/holgerbrandl/krangl/actions?query=workflow%3Abuild) [![Gitter](https://badges.gitter.im/holgerbrandl/krangl.svg)](https://gitter.im/holgerbrandl/krangl?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
22

33
This is the manual of [krangl](https://github.com/holgerbrandl/krangl).
44

@@ -40,7 +40,7 @@ repositories {
4040
}
4141
4242
dependencies {
43-
implementation "com.github.holgerbrandl:krangl:0.18"
43+
implementation "com.github.holgerbrandl:krangl:0.18.1"
4444
}
4545
```
4646
Declaring the repository is purely optional as it is the default already.

src/main/kotlin/krangl/Builder.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,9 @@ inline fun <reified T> DataFrame.unfold(
123123
val extProperties = properties + properties.map { "get" + it.capitalize() }
124124
val propsOrGetters = detectPropertiesByReflection<T>()
125125

126-
127126
val filtMembers = propsOrGetters
128127
// match by name
129-
.filter { extProperties.contains(it.name) }
128+
.filter { it.parameters.size==1 && extProperties.contains(it.name) } // discard extension functions in class body
130129

131130
// todo make sure that unfolded columns are not yet present in df, and warn if so and append _1, _2, ... suffix
132131
val unfolded = filtMembers.fold(this) { df, kCallable ->

src/test/kotlin/krangl/test/TypeInterfaceTest.kt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import java.io.File
99
import java.io.PrintStream
1010
import java.net.URL
1111
import java.util.*
12+
import kotlin.time.Duration
1213

1314
/**
1415
* @author Holger Brandl
@@ -280,6 +281,38 @@ class ValueClassTests {
280281
}
281282
}
282283

284+
class ExtensionPropertyTest {
285+
286+
class Something(
287+
val foo: String,
288+
val bar: Int?,
289+
) {
290+
val Duration.ticks: Double
291+
get() = 0.0
292+
293+
val Int.other: Double
294+
get() = 0.0
295+
}
296+
297+
298+
@Test
299+
fun `it should support nullable value class properties in asDataFrame`() {
300+
val df = dataFrameOf(
301+
AnyCol(
302+
"st", listOf(
303+
Something("hey", 42),
304+
Something("ho", null)
305+
)
306+
)
307+
)
308+
309+
val dfUnfold = df.unfold<Something>("st")
310+
311+
dfUnfold.ncol shouldBe 3
312+
dfUnfold.names shouldBe listOf("st", "bar", "foo")
313+
}
314+
}
315+
283316
internal data class CapturedOutput(val stdout: String, val stderr: String)
284317

285318
internal fun captureOutput(expr: () -> Any): CapturedOutput {

0 commit comments

Comments
 (0)