Skip to content

Commit ba0f76f

Browse files
committed
Remove data modifier from Gather
Once again hiding `copy` from completion
1 parent 6ee612c commit ba0f76f

File tree

2 files changed

+52
-10
lines changed

2 files changed

+52
-10
lines changed

core/api/core.api

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2359,11 +2359,13 @@ public final class org/jetbrains/kotlinx/dataframe/api/Gather {
23592359
public fun <init> (Lorg/jetbrains/kotlinx/dataframe/DataFrame;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/reflect/KType;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Z)V
23602360
public synthetic fun <init> (Lorg/jetbrains/kotlinx/dataframe/DataFrame;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/reflect/KType;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V
23612361
public final fun cast ()Lorg/jetbrains/kotlinx/dataframe/api/Gather;
2362-
public final fun copy (Lorg/jetbrains/kotlinx/dataframe/DataFrame;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/reflect/KType;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Z)Lorg/jetbrains/kotlinx/dataframe/api/Gather;
2363-
public static synthetic fun copy$default (Lorg/jetbrains/kotlinx/dataframe/api/Gather;Lorg/jetbrains/kotlinx/dataframe/DataFrame;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/reflect/KType;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;ZILjava/lang/Object;)Lorg/jetbrains/kotlinx/dataframe/api/Gather;
2364-
public fun equals (Ljava/lang/Object;)Z
2365-
public fun hashCode ()I
2366-
public fun toString ()Ljava/lang/String;
2362+
public final fun getColumns ()Lkotlin/jvm/functions/Function2;
2363+
public final fun getDf ()Lorg/jetbrains/kotlinx/dataframe/DataFrame;
2364+
public final fun getExplode ()Z
2365+
public final fun getFilter ()Lkotlin/jvm/functions/Function2;
2366+
public final fun getKeyTransform ()Lkotlin/jvm/functions/Function1;
2367+
public final fun getKeyType ()Lkotlin/reflect/KType;
2368+
public final fun getValueTransform ()Lkotlin/jvm/functions/Function1;
23672369
}
23682370

23692371
public final class org/jetbrains/kotlinx/dataframe/api/GatherKt {

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

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,27 +45,67 @@ public fun <T, C> DataFrame<T>.gather(vararg columns: KProperty<C>): Gather<T, C
4545
// endregion
4646

4747
public fun <T, C, K, R> Gather<T, C, K, R>.where(filter: RowValueFilter<T, C>): Gather<T, C, K, R> =
48-
copy(filter = this.filter and filter)
48+
Gather(
49+
df = df,
50+
columns = columns,
51+
filter = this.filter and filter,
52+
keyType = keyType,
53+
keyTransform = keyTransform,
54+
valueTransform = valueTransform,
55+
explode = explode,
56+
)
4957

5058
public fun <T, C, K, R> Gather<T, C?, K, R>.notNull(): Gather<T, C, K, R> = where { it != null } as Gather<T, C, K, R>
5159

52-
public fun <T, C, K, R> Gather<T, C, K, R>.explodeLists(): Gather<T, C, K, R> = copy(explode = true)
60+
public fun <T, C, K, R> Gather<T, C, K, R>.explodeLists(): Gather<T, C, K, R> =
61+
Gather(
62+
df = df,
63+
columns = columns,
64+
filter = filter,
65+
keyType = keyType,
66+
keyTransform = keyTransform,
67+
valueTransform = valueTransform,
68+
explode = true,
69+
)
5370

5471
public inline fun <T, C, reified K, R> Gather<T, C, *, R>.mapKeys(
5572
noinline transform: (String) -> K,
5673
): Gather<T, C, K, R> =
57-
copy(keyTransform = transform as ((String) -> Nothing), keyType = typeOf<K>()) as Gather<T, C, K, R>
74+
Gather(
75+
df = df,
76+
columns = columns,
77+
filter = filter,
78+
keyType = typeOf<K>(),
79+
keyTransform = transform,
80+
valueTransform = valueTransform,
81+
explode = explode,
82+
)
5883

5984
public fun <T, C, K, R> Gather<T, C, K, *>.mapValues(transform: (C) -> R): Gather<T, C, K, R> =
60-
copy(valueTransform = transform as ((C) -> Nothing)) as Gather<T, C, K, R>
85+
Gather(
86+
df = df,
87+
columns = columns,
88+
filter = filter,
89+
keyType = keyType,
90+
keyTransform = keyTransform,
91+
valueTransform = transform,
92+
explode = explode,
93+
)
6194

62-
public data class Gather<T, C, K, R>(
95+
public class Gather<T, C, K, R>(
96+
@PublishedApi
6397
internal val df: DataFrame<T>,
98+
@PublishedApi
6499
internal val columns: ColumnsSelector<T, C>,
100+
@PublishedApi
65101
internal val filter: RowValueFilter<T, C>? = null,
102+
@PublishedApi
66103
internal val keyType: KType? = null,
104+
@PublishedApi
67105
internal val keyTransform: ((String) -> K),
106+
@PublishedApi
68107
internal val valueTransform: ((C) -> R)? = null,
108+
@PublishedApi
69109
internal val explode: Boolean = false,
70110
) {
71111
public fun <P> cast(): Gather<T, P, K, P> {

0 commit comments

Comments
 (0)