@@ -16,6 +16,7 @@ import org.jetbrains.kotlinx.dataframe.api.getColumnsWithPaths
16
16
import org.jetbrains.kotlinx.dataframe.api.isColumnGroup
17
17
import org.jetbrains.kotlinx.dataframe.api.minus
18
18
import org.jetbrains.kotlinx.dataframe.api.pathOf
19
+ import org.jetbrains.kotlinx.dataframe.api.toDataFrame
19
20
import org.jetbrains.kotlinx.dataframe.columns.FrameColumn
20
21
import org.jetbrains.kotlinx.dataframe.impl.aggregation.AggregatableInternal
21
22
import org.jetbrains.kotlinx.dataframe.impl.aggregation.GroupByReceiverImpl
@@ -29,14 +30,26 @@ import org.jetbrains.kotlinx.dataframe.ncol
29
30
import org.jetbrains.kotlinx.dataframe.nrow
30
31
import org.jetbrains.kotlinx.dataframe.values
31
32
33
+ /* *
34
+ * Internal implementation interface for [GroupBy].
35
+ *
36
+ * While [df] should be hidden in the [GroupBy] DSL, it must be accessible when running
37
+ * [GroupBy.toDataFrame].
38
+ *
39
+ * This interface is public to allow Kandy to implement it.
40
+ */
41
+ public interface GroupByInternal <T , G > : GroupBy <T , G > {
42
+ public val df: DataFrame <T >
43
+ }
44
+
32
45
/* *
33
46
* @property df DataFrame containing [groups] column and key columns. Represents GroupBy.
34
47
*/
35
48
internal class GroupByImpl <T , G >(
36
- val df : DataFrame <T >,
49
+ override val df : DataFrame <T >,
37
50
override val groups : FrameColumn <G >,
38
51
internal val keyColumnsInGroups : ColumnsSelector <G , * >,
39
- ) : GroupBy <T, G>,
52
+ ) : GroupByInternal <T, G>,
40
53
AggregatableInternal <G > {
41
54
42
55
override val keys by lazy { df - groups }
0 commit comments