Skip to content

Commit 62b4894

Browse files
Automated commit of generated code
1 parent c0e44e6 commit 62b4894

File tree

2 files changed

+28
-0
lines changed
  • core/generated-sources/src
    • main/kotlin/org/jetbrains/kotlinx/dataframe/api
    • test/kotlin/org/jetbrains/kotlinx/dataframe/api

2 files changed

+28
-0
lines changed

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/gather.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,19 @@ public fun <T, C, K, R> Gather<T, C, K, R>.explodeLists(): Gather<T, C, K, R> =
7171
explode = true,
7272
)
7373

74+
@JvmName("explodeListsTyped")
75+
@Interpretable("GatherExplodeLists")
76+
public fun <T, C, K, R> Gather<T, List<C>, K, R>.explodeLists(): Gather<T, C, K, R> =
77+
Gather(
78+
df = df,
79+
columns = columns,
80+
filter = filter,
81+
keyType = keyType,
82+
keyTransform = keyTransform,
83+
valueTransform = valueTransform,
84+
explode = true,
85+
) as Gather<T, C, K, R>
86+
7487
@Interpretable("GatherMap")
7588
public inline fun <T, C, reified K, R> Gather<T, C, *, R>.mapKeys(
7689
noinline transform: (String) -> K,

core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/gather.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,4 +187,19 @@ class GatherTests {
187187
"b", 5,
188188
)
189189
}
190+
191+
@Test
192+
fun `gather explode lists typed`() {
193+
val df = dataFrameOf("list" to columnOf(listOf(1, 2, 3)))
194+
.gather { "list"<List<Int>>() }
195+
.explodeLists()
196+
.mapValues { listOf(it) }
197+
.into("key", "value")
198+
199+
df shouldBe dataFrameOf("key", "value")(
200+
"list", listOf(1),
201+
"list", listOf(2),
202+
"list", listOf(3),
203+
)
204+
}
190205
}

0 commit comments

Comments
 (0)