@@ -19,23 +19,23 @@ import kotlin.reflect.typeOf
19
19
@PublishedApi
20
20
internal inline fun <C , reified V , R > Aggregator <V , R >.aggregateOf (
21
21
values : Iterable <C >,
22
- noinline transform : (C ) -> V ,
22
+ crossinline transform : (C ) -> V ? ,
23
23
): R =
24
24
aggregate(
25
- values = values.asSequence().mapNotNull( transform) .asIterable(),
25
+ values = values.asSequence().mapNotNull { transform(it) } .asIterable(),
26
26
type = typeOf<V >().withNullability(false ),
27
27
)
28
28
29
29
@PublishedApi
30
30
internal inline fun <C , reified V , R > Aggregator <V , R >.aggregateOf (
31
31
column : DataColumn <C >,
32
- noinline transform : (C ) -> V ,
32
+ crossinline transform : (C ) -> V ? ,
33
33
): R = aggregateOf(column.values(), transform)
34
34
35
35
@PublishedApi
36
36
internal inline fun <T , reified C , R > Aggregator <* , R >.aggregateOf (
37
37
frame : DataFrame <T >,
38
- crossinline expression : RowExpression <T , C >,
38
+ crossinline expression : RowExpression <T , C ? >,
39
39
): R = (this as Aggregator <C , R >).aggregateOf(frame.rows()) { expression(it, it) }
40
40
41
41
@PublishedApi
@@ -48,33 +48,23 @@ internal fun <T, C, R> Aggregator<*, R>.aggregateOfDelegated(
48
48
body(this , this )
49
49
}
50
50
51
- @PublishedApi
52
- internal inline fun <T , reified C , R > Aggregator <* , R >.of (
53
- data : DataFrame <T >,
54
- crossinline expression : RowExpression <T , C >,
55
- ): R = aggregateOf(data as DataFrame <T >, expression)
56
-
57
- @PublishedApi
58
- internal inline fun <C , reified V , R > Aggregator <V , R >.of (data : DataColumn <C >, crossinline expression : (C ) -> V ): R =
59
- aggregateOf(data.values()) { expression(it) }
60
-
61
51
@PublishedApi
62
52
internal inline fun <T , reified C , reified R > Aggregator <* , R >.aggregateOf (
63
53
data : Grouped <T >,
64
54
resultName : String? = null,
65
- crossinline expression : RowExpression <T , C >,
55
+ crossinline expression : RowExpression <T , C ? >,
66
56
): DataFrame <T > = data.aggregateOf(resultName, expression, this as Aggregator <C , R >)
67
57
68
58
@PublishedApi
69
59
internal inline fun <T , reified C , reified R > Aggregator <* , R >.aggregateOf (
70
60
data : PivotGroupBy <T >,
71
- crossinline expression : RowExpression <T , C >,
61
+ crossinline expression : RowExpression <T , C ? >,
72
62
): DataFrame <T > = data.aggregateOf(expression, this as Aggregator <C , R >)
73
63
74
64
@PublishedApi
75
65
internal inline fun <T , reified C , reified R > Grouped<T>.aggregateOf (
76
66
resultName : String? ,
77
- crossinline expression : RowExpression <T , C >,
67
+ crossinline expression : RowExpression <T , C ? >,
78
68
aggregator : Aggregator <C , R >,
79
69
): DataFrame <T > {
80
70
val path = pathOf(resultName ? : aggregator.name)
@@ -97,7 +87,7 @@ internal inline fun <T, reified C, reified R> Grouped<T>.aggregateOf(
97
87
98
88
@PublishedApi
99
89
internal inline fun <T , reified C , R > PivotGroupBy<T>.aggregateOf (
100
- crossinline expression : RowExpression <T , C >,
90
+ crossinline expression : RowExpression <T , C ? >,
101
91
aggregator : Aggregator <C , R >,
102
92
): DataFrame <T > =
103
93
aggregate {
0 commit comments