File tree Expand file tree Collapse file tree 4 files changed +4
-13
lines changed
main/kotlin/org/jetbrains/kotlinx/dataframe
test/kotlin/org/jetbrains/kotlinx/dataframe/testSets/person Expand file tree Collapse file tree 4 files changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import kotlin.reflect.KProperty
16
16
/* *
17
17
* Provides access to [columns][DataColumn].
18
18
*
19
- * Base interface for [DataFrame] and [column selection DSLs][ ColumnSelectionDsl]
19
+ * Base interface for [DataFrame] and [ColumnSelectionDsl]
20
20
*
21
21
* @param T Schema marker. Used to generate extension properties for typed column access.
22
22
*/
Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ import org.jetbrains.kotlinx.dataframe.columns.UnresolvedColumnsPolicy
17
17
import org.jetbrains.kotlinx.dataframe.columns.renamedReference
18
18
import org.jetbrains.kotlinx.dataframe.impl.DataFrameReceiver
19
19
import org.jetbrains.kotlinx.dataframe.impl.columnName
20
- import org.jetbrains.kotlinx.dataframe.impl.columns.ColumnAccessorImpl
21
20
import org.jetbrains.kotlinx.dataframe.impl.columns.ColumnsList
22
21
import org.jetbrains.kotlinx.dataframe.impl.columns.DistinctColumnSet
23
22
import org.jetbrains.kotlinx.dataframe.impl.columns.allColumnsExcept
@@ -36,19 +35,11 @@ import kotlin.reflect.typeOf
36
35
37
36
public interface ColumnSelectionDsl <out T > : ColumnsContainer <T > {
38
37
39
- public operator fun <C > ColumnReference<C>.invoke (): DataColumn <C > = get(this )
40
-
41
- public operator fun <T > ColumnReference<DataRow<T>>.invoke (): ColumnGroup <T > = get(this )
42
-
43
- public operator fun <C > ColumnReference<C>.invoke (newName : String ): ColumnReference <C > = renamedReference(newName)
44
-
45
38
public operator fun <C > ColumnPath.invoke (): DataColumn <C > = getColumn(this ).cast()
46
39
47
40
public operator fun <C > String.invoke (): DataColumn <C > = getColumn(this ).cast()
48
41
49
42
public operator fun String.get (column : String ): ColumnPath = pathOf(this , column)
50
-
51
- public fun <C > String.cast (): ColumnAccessor <C > = ColumnAccessorImpl (this )
52
43
}
53
44
54
45
public interface ColumnsSelectionDsl <out T > : ColumnSelectionDsl <T >, SingleColumn <DataRow <T >> {
Original file line number Diff line number Diff line change @@ -23,13 +23,13 @@ import kotlin.reflect.KProperty
23
23
public interface SortDsl <out T > : ColumnsSelectionDsl <T > {
24
24
25
25
public fun <C > ColumnSet<C>.desc (): ColumnSet <C > = addFlag(SortFlag .Reversed )
26
- public fun String.desc (): ColumnSet <Comparable <* >? > = cast <Comparable <* >>().desc()
26
+ public fun String.desc (): ColumnSet <Comparable <* >? > = invoke <Comparable <* >>().desc()
27
27
public fun <C > KProperty<C>.desc (): ColumnSet <C > = toColumnAccessor().desc()
28
28
29
29
public fun <C > ColumnSet<C?>.nullsLast (flag : Boolean = true): ColumnSet <C ?> =
30
30
if (flag) addFlag(SortFlag .NullsLast ) else this
31
31
32
- public fun String.nullsLast (flag : Boolean = true): ColumnSet <Comparable <* >? > = cast <Comparable <* >>().nullsLast(flag)
32
+ public fun String.nullsLast (flag : Boolean = true): ColumnSet <Comparable <* >? > = invoke <Comparable <* >>().nullsLast(flag)
33
33
public fun <C > KProperty<C?>.nullsLast (flag : Boolean = true): ColumnSet <C ?> = toColumnAccessor().nullsLast(flag)
34
34
}
35
35
Original file line number Diff line number Diff line change @@ -451,7 +451,7 @@ class DataFrameTests : BaseTest() {
451
451
452
452
df.sortBy { Person ::name and Person ::age.desc() }.check()
453
453
454
- df.sortBy { " name" .cast <String >() and " age" .desc() }.check()
454
+ df.sortBy { " name" <String >() and " age" .desc() }.check()
455
455
}
456
456
457
457
@Test
You can’t perform that action at this time.
0 commit comments