File tree Expand file tree Collapse file tree 2 files changed +42
-8
lines changed
generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/aggregation
src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/aggregation Expand file tree Collapse file tree 2 files changed +42
-8
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,29 @@ internal class ConfiguredAggregateColumn<C> private constructor(
17
17
private fun ColumnWithPath<C>.toDescriptor (keepName : Boolean ): AggregateColumnDescriptor <C > =
18
18
when (val col = this ) {
19
19
is AggregateColumnDescriptor <C > -> {
20
- val path = if (keepName) newPath?.plus(col.newPath ? : col.column.shortPath()) ? : col.newPath
21
- else newPath ? : col.newPath
22
- AggregateColumnDescriptor (col.column, default ? : col.default, path)
20
+
21
+ // Fix for K2 smart-casting changes
22
+ val currentDefault = this @ConfiguredAggregateColumn.default
23
+ val currentNewPath = this @ConfiguredAggregateColumn.newPath
24
+
25
+ val newPath = when {
26
+ currentNewPath == null -> col.newPath
27
+ keepName -> currentNewPath + (col.newPath ? : col.column.shortPath())
28
+ else -> currentNewPath
29
+ }
30
+ AggregateColumnDescriptor (
31
+ column = col.column,
32
+ default = currentDefault ? : col.default,
33
+ newPath = newPath,
34
+ )
23
35
}
24
36
25
- else -> AggregateColumnDescriptor (col, default, if (keepName) newPath?.plus(col.name) else newPath)
37
+ else ->
38
+ AggregateColumnDescriptor (
39
+ column = col,
40
+ default = default,
41
+ newPath = if (keepName) newPath?.plus(col.name) else newPath,
42
+ )
26
43
}
27
44
28
45
private fun resolve (context : ColumnResolutionContext , columns : ColumnsResolver <C >): List <ColumnWithPath <C >> {
Original file line number Diff line number Diff line change @@ -17,12 +17,29 @@ internal class ConfiguredAggregateColumn<C> private constructor(
17
17
private fun ColumnWithPath<C>.toDescriptor (keepName : Boolean ): AggregateColumnDescriptor <C > =
18
18
when (val col = this ) {
19
19
is AggregateColumnDescriptor <C > -> {
20
- val path = if (keepName) newPath?.plus(col.newPath ? : col.column.shortPath()) ? : col.newPath
21
- else newPath ? : col.newPath
22
- AggregateColumnDescriptor (col.column, default ? : col.default, path)
20
+
21
+ // Fix for K2 smart-casting changes
22
+ val currentDefault = this @ConfiguredAggregateColumn.default
23
+ val currentNewPath = this @ConfiguredAggregateColumn.newPath
24
+
25
+ val newPath = when {
26
+ currentNewPath == null -> col.newPath
27
+ keepName -> currentNewPath + (col.newPath ? : col.column.shortPath())
28
+ else -> currentNewPath
29
+ }
30
+ AggregateColumnDescriptor (
31
+ column = col.column,
32
+ default = currentDefault ? : col.default,
33
+ newPath = newPath,
34
+ )
23
35
}
24
36
25
- else -> AggregateColumnDescriptor (col, default, if (keepName) newPath?.plus(col.name) else newPath)
37
+ else ->
38
+ AggregateColumnDescriptor (
39
+ column = col,
40
+ default = default,
41
+ newPath = if (keepName) newPath?.plus(col.name) else newPath,
42
+ )
26
43
}
27
44
28
45
private fun resolve (context : ColumnResolutionContext , columns : ColumnsResolver <C >): List <ColumnWithPath <C >> {
You can’t perform that action at this time.
0 commit comments