@@ -4,6 +4,8 @@ import org.jetbrains.kotlinx.dataframe.ColumnsSelector
4
4
import org.jetbrains.kotlinx.dataframe.DataFrame
5
5
import org.jetbrains.kotlinx.dataframe.RowValueFilter
6
6
import org.jetbrains.kotlinx.dataframe.annotations.AccessApiOverload
7
+ import org.jetbrains.kotlinx.dataframe.annotations.Interpretable
8
+ import org.jetbrains.kotlinx.dataframe.annotations.Refine
7
9
import org.jetbrains.kotlinx.dataframe.columns.ColumnAccessor
8
10
import org.jetbrains.kotlinx.dataframe.columns.ColumnReference
9
11
import org.jetbrains.kotlinx.dataframe.columns.toColumnSet
@@ -15,6 +17,7 @@ import kotlin.reflect.typeOf
15
17
16
18
// region gather
17
19
20
+ @Interpretable(" Gather0" )
18
21
public fun <T , C > DataFrame<T>.gather (selector : ColumnsSelector <T , C >): Gather <T , C , String , C > =
19
22
Gather (
20
23
df = this ,
@@ -44,6 +47,7 @@ public fun <T, C> DataFrame<T>.gather(vararg columns: KProperty<C>): Gather<T, C
44
47
45
48
// endregion
46
49
50
+ @Interpretable(" GatherWhere" )
47
51
public fun <T , C , K , R > Gather <T , C , K , R >.where (filter : RowValueFilter <T , C >): Gather <T , C , K , R > =
48
52
Gather (
49
53
df = df,
@@ -55,8 +59,10 @@ public fun <T, C, K, R> Gather<T, C, K, R>.where(filter: RowValueFilter<T, C>):
55
59
explode = explode,
56
60
)
57
61
62
+ @Interpretable(" GatherChangeType" )
58
63
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 >
59
64
65
+ @Interpretable(" GatherExplodeLists" )
60
66
public fun <T , C , K , R > Gather <T , C , K , R >.explodeLists (): Gather <T , C , K , R > =
61
67
Gather (
62
68
df = df,
@@ -68,6 +74,7 @@ public fun <T, C, K, R> Gather<T, C, K, R>.explodeLists(): Gather<T, C, K, R> =
68
74
explode = true ,
69
75
)
70
76
77
+ @Interpretable(" GatherMap" )
71
78
public inline fun <T , C , reified K , R > Gather <T , C , * , R >.mapKeys (
72
79
noinline transform : (String ) -> K ,
73
80
): Gather <T , C , K , R > =
@@ -81,6 +88,7 @@ public inline fun <T, C, reified K, R> Gather<T, C, *, R>.mapKeys(
81
88
explode = explode,
82
89
)
83
90
91
+ @Interpretable(" GatherMap" )
84
92
public fun <T , C , K , R > Gather <T , C , K , * >.mapValues (transform : (C ) -> R ): Gather <T , C , K , R > =
85
93
Gather (
86
94
df = df,
@@ -108,6 +116,7 @@ public class Gather<T, C, K, R>(
108
116
@PublishedApi
109
117
internal val explode : Boolean = false ,
110
118
) {
119
+ @Interpretable(" GatherChangeType" )
111
120
public fun <P > cast (): Gather <T , P , K , P > {
112
121
// TODO: introduce GatherWithTransform to avoid this error
113
122
require(valueTransform == null ) { " Cast is not allowed to be called after `mapValues`" }
@@ -117,6 +126,8 @@ public class Gather<T, C, K, R>(
117
126
118
127
// region into
119
128
129
+ @Refine
130
+ @Interpretable(" GatherInto" )
120
131
public fun <T , C , K , R > Gather <T , C , K , R >.into (keyColumn : String , valueColumn : String ): DataFrame <T > =
121
132
gatherImpl(keyColumn, valueColumn)
122
133
@@ -140,6 +151,8 @@ public fun <T, C, K, R> Gather<T, C, K, R>.into(keyColumn: KProperty<K>, valueCo
140
151
141
152
// region keysInto
142
153
154
+ @Refine
155
+ @Interpretable(" GatherKeysInto" )
143
156
public fun <T , C , K , R > Gather <T , C , K , R >.keysInto (keyColumn : String ): DataFrame <T > = gatherImpl(keyColumn, null )
144
157
145
158
@Deprecated(
@@ -160,6 +173,8 @@ public fun <T, C, K, R> Gather<T, C, K, R>.keysInto(keyColumn: KProperty<K>): Da
160
173
161
174
// region valuesInto
162
175
176
+ @Refine
177
+ @Interpretable(" GatherValuesInto" )
163
178
public fun <T , C , K , R > Gather <T , C , K , R >.valuesInto (valueColumn : String ): DataFrame <T > = gatherImpl(null , valueColumn)
164
179
165
180
@Deprecated(
0 commit comments