Skip to content

Commit 6e4bf14

Browse files
committed
[Compiler plugin] Remove outdated code
1 parent 5f3b13f commit 6e4bf14

File tree

4 files changed

+8
-72
lines changed

4 files changed

+8
-72
lines changed

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/insert.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import kotlin.reflect.KProperty
1919

2020
// region insert
2121

22-
@Interpretable("Insert0")
2322
public fun <T, C> DataFrame<T>.insert(column: DataColumn<C>): InsertClause<T> = InsertClause(this, column)
2423

2524
@Interpretable("Insert1")
@@ -29,15 +28,13 @@ public inline fun <T, reified R> DataFrame<T>.insert(
2928
noinline expression: RowExpression<T, R>,
3029
): InsertClause<T> = insert(mapToColumn(name, infer, expression))
3130

32-
@Interpretable("Insert2")
3331
@AccessApiOverload
3432
public inline fun <T, reified R> DataFrame<T>.insert(
3533
column: ColumnAccessor<R>,
3634
infer: Infer = Infer.Nulls,
3735
noinline expression: RowExpression<T, R>,
3836
): InsertClause<T> = insert(column.name(), infer, expression)
3937

40-
@Interpretable("Insert3")
4138
@AccessApiOverload
4239
public inline fun <T, reified R> DataFrame<T>.insert(
4340
column: KProperty<R>,
@@ -62,12 +59,9 @@ public fun <T> InsertClause<T>.under(column: ColumnSelector<T, *>): DataFrame<T>
6259
public fun <T> InsertClause<T>.under(columnPath: ColumnPath): DataFrame<T> =
6360
df.insertImpl(columnPath + column.name, column)
6461

65-
@Refine
66-
@Interpretable("Under2")
62+
@AccessApiOverload
6763
public fun <T> InsertClause<T>.under(column: ColumnAccessor<*>): DataFrame<T> = under(column.path())
6864

69-
@Refine
70-
@Interpretable("Under3")
7165
@AccessApiOverload
7266
public fun <T> InsertClause<T>.under(column: KProperty<*>): DataFrame<T> = under(column.columnName)
7367

plugins/kotlin-dataframe/src/org/jetbrains/kotlinx/dataframe/plugin/impl/api/convert.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import org.jetbrains.kotlin.fir.types.ConeNullability
99
import org.jetbrains.kotlin.fir.types.typeContext
1010
import org.jetbrains.kotlin.fir.types.withNullability
1111
import org.jetbrains.kotlin.name.Name
12-
import org.jetbrains.kotlinx.dataframe.api.Infer
1312
import org.jetbrains.kotlinx.dataframe.plugin.extensions.KotlinTypeFacade
1413
import org.jetbrains.kotlinx.dataframe.plugin.extensions.wrap
1514
import org.jetbrains.kotlinx.dataframe.plugin.impl.Absent
@@ -24,7 +23,6 @@ import org.jetbrains.kotlinx.dataframe.plugin.impl.SimpleColumnGroup
2423
import org.jetbrains.kotlinx.dataframe.plugin.impl.SimpleDataColumn
2524
import org.jetbrains.kotlinx.dataframe.plugin.impl.SimpleFrameColumn
2625
import org.jetbrains.kotlinx.dataframe.plugin.impl.dataFrame
27-
import org.jetbrains.kotlinx.dataframe.plugin.impl.enum
2826
import org.jetbrains.kotlinx.dataframe.plugin.impl.ignore
2927
import org.jetbrains.kotlinx.dataframe.plugin.impl.simpleColumnOf
3028
import org.jetbrains.kotlinx.dataframe.plugin.impl.type
@@ -54,7 +52,7 @@ class ConvertApproximation(val schema: PluginDataFrameSchema, val columns: List<
5452
internal class Convert6 : AbstractInterpreter<PluginDataFrameSchema>() {
5553
val Arguments.firstCol: String by arg()
5654
val Arguments.cols: List<String> by arg(defaultValue = Present(emptyList()))
57-
val Arguments.infer: Infer by enum(defaultValue = Present(Infer.Nulls))
55+
val Arguments.infer by ignore()
5856
val Arguments.expression: TypeApproximation by type()
5957
val Arguments.receiver: PluginDataFrameSchema by dataFrame()
6058
override val Arguments.startingSchema get() = receiver

plugins/kotlin-dataframe/src/org/jetbrains/kotlinx/dataframe/plugin/impl/api/insert.kt

Lines changed: 6 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
package org.jetbrains.kotlinx.dataframe.plugin.impl.api
22

33
import org.jetbrains.kotlinx.dataframe.DataFrame
4-
import org.jetbrains.kotlinx.dataframe.api.Infer
54
import org.jetbrains.kotlinx.dataframe.api.after
65
import org.jetbrains.kotlinx.dataframe.api.insert
76
import org.jetbrains.kotlinx.dataframe.api.pathOf
87
import org.jetbrains.kotlinx.dataframe.api.under
98
import org.jetbrains.kotlinx.dataframe.plugin.impl.AbstractInterpreter
109
import org.jetbrains.kotlinx.dataframe.plugin.impl.Arguments
1110
import org.jetbrains.kotlinx.dataframe.plugin.impl.PluginDataFrameSchema
12-
import org.jetbrains.kotlinx.dataframe.plugin.impl.Present
13-
import org.jetbrains.kotlinx.dataframe.plugin.impl.SimpleCol
1411
import org.jetbrains.kotlinx.dataframe.plugin.impl.asDataColumn
1512
import org.jetbrains.kotlinx.dataframe.plugin.impl.asDataFrame
16-
import org.jetbrains.kotlinx.dataframe.plugin.impl.data.ColumnAccessorApproximation
1713
import org.jetbrains.kotlinx.dataframe.plugin.impl.data.ColumnPathApproximation
1814
import org.jetbrains.kotlinx.dataframe.plugin.impl.data.InsertClauseApproximation
19-
import org.jetbrains.kotlinx.dataframe.plugin.impl.data.KPropertyApproximation
2015
import org.jetbrains.kotlinx.dataframe.plugin.impl.dataFrame
21-
import org.jetbrains.kotlinx.dataframe.plugin.impl.enum
16+
import org.jetbrains.kotlinx.dataframe.plugin.impl.ignore
2217
import org.jetbrains.kotlinx.dataframe.plugin.impl.simpleColumnOf
2318
import org.jetbrains.kotlinx.dataframe.plugin.impl.toPluginDataFrameSchema
2419
import org.jetbrains.kotlinx.dataframe.plugin.impl.type
@@ -27,17 +22,18 @@ import org.jetbrains.kotlinx.dataframe.plugin.impl.type
2722
* @see DataFrame.insert
2823
*/
2924
internal class Insert0 : AbstractInterpreter<InsertClauseApproximation>() {
30-
val Arguments.column: SimpleCol by arg()
31-
val Arguments.receiver: PluginDataFrameSchema by dataFrame()
25+
val Arguments.receiver by dataFrame()
26+
val Arguments.name: String by arg()
27+
val Arguments.typeArg1 by type()
3228

3329
override fun Arguments.interpret(): InsertClauseApproximation {
34-
return InsertClauseApproximation(receiver, column)
30+
return InsertClauseApproximation(receiver, simpleColumnOf(name, typeArg1.type))
3531
}
3632
}
3733

3834
internal class Insert1 : AbstractInterpreter<InsertClauseApproximation>() {
3935
val Arguments.name: String by arg()
40-
val Arguments.infer: Infer by enum(defaultValue = Present(Infer.Nulls))
36+
val Arguments.infer by ignore()
4137
val Arguments.expression: TypeApproximation by type()
4238
val Arguments.receiver: PluginDataFrameSchema by dataFrame()
4339

@@ -46,28 +42,6 @@ internal class Insert1 : AbstractInterpreter<InsertClauseApproximation>() {
4642
}
4743
}
4844

49-
internal class Insert2 : AbstractInterpreter<InsertClauseApproximation>() {
50-
val Arguments.column: ColumnAccessorApproximation by arg()
51-
val Arguments.infer: Infer by enum(defaultValue = Present(Infer.Nulls))
52-
val Arguments.expression: TypeApproximation by type()
53-
val Arguments.receiver: PluginDataFrameSchema by dataFrame()
54-
55-
override fun Arguments.interpret(): InsertClauseApproximation {
56-
return InsertClauseApproximation(receiver, simpleColumnOf(column.name, expression.type))
57-
}
58-
}
59-
60-
internal class Insert3 : AbstractInterpreter<InsertClauseApproximation>() {
61-
val Arguments.column: KPropertyApproximation by arg()
62-
val Arguments.infer: Infer by enum(defaultValue = Present(Infer.Nulls))
63-
val Arguments.expression: TypeApproximation by type()
64-
val Arguments.receiver: PluginDataFrameSchema by dataFrame()
65-
66-
override fun Arguments.interpret(): InsertClauseApproximation {
67-
return InsertClauseApproximation(receiver, simpleColumnOf(column.name, expression.type))
68-
}
69-
}
70-
7145
internal class Under0 : AbstractInterpreter<PluginDataFrameSchema>() {
7246
val Arguments.column: SingleColumnApproximation by arg()
7347
val Arguments.receiver: InsertClauseApproximation by arg()
@@ -91,28 +65,6 @@ internal class Under1 : AbstractInterpreter<PluginDataFrameSchema>() {
9165
}
9266
}
9367

94-
internal class Under2 : AbstractInterpreter<PluginDataFrameSchema>() {
95-
val Arguments.column: ColumnAccessorApproximation by arg()
96-
val Arguments.receiver: InsertClauseApproximation by arg()
97-
98-
override fun Arguments.interpret(): PluginDataFrameSchema {
99-
return receiver.df.asDataFrame()
100-
.insert(receiver.column.asDataColumn()).under(pathOf(column.name))
101-
.toPluginDataFrameSchema()
102-
}
103-
}
104-
105-
internal class Under3 : AbstractInterpreter<PluginDataFrameSchema>() {
106-
val Arguments.column: KPropertyApproximation by arg()
107-
val Arguments.receiver: InsertClauseApproximation by arg()
108-
109-
override fun Arguments.interpret(): PluginDataFrameSchema {
110-
return receiver.df.asDataFrame()
111-
.insert(receiver.column.asDataColumn()).under(pathOf(column.name))
112-
.toPluginDataFrameSchema()
113-
}
114-
}
115-
11668
internal class Under4 : AbstractInterpreter<PluginDataFrameSchema>() {
11769
val Arguments.column: String by arg()
11870
val Arguments.receiver: InsertClauseApproximation by arg()

plugins/kotlin-dataframe/src/org/jetbrains/kotlinx/dataframe/plugin/loadInterpreter.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ import org.jetbrains.kotlinx.dataframe.plugin.impl.api.AggregateDslInto
2828
import org.jetbrains.kotlinx.dataframe.plugin.impl.api.GroupByToDataFrame
2929
import org.jetbrains.kotlinx.dataframe.plugin.impl.api.Insert0
3030
import org.jetbrains.kotlinx.dataframe.plugin.impl.api.Insert1
31-
import org.jetbrains.kotlinx.dataframe.plugin.impl.api.Insert2
32-
import org.jetbrains.kotlinx.dataframe.plugin.impl.api.Insert3
3331
import org.jetbrains.kotlinx.dataframe.plugin.impl.api.Into
3432
import org.jetbrains.kotlinx.dataframe.plugin.impl.api.Into0
3533
import org.jetbrains.kotlinx.dataframe.plugin.impl.api.Join0
@@ -44,8 +42,6 @@ import org.jetbrains.kotlinx.dataframe.plugin.impl.api.Select0
4442
import org.jetbrains.kotlinx.dataframe.plugin.impl.api.To0
4543
import org.jetbrains.kotlinx.dataframe.plugin.impl.api.Under0
4644
import org.jetbrains.kotlinx.dataframe.plugin.impl.api.Under1
47-
import org.jetbrains.kotlinx.dataframe.plugin.impl.api.Under2
48-
import org.jetbrains.kotlinx.dataframe.plugin.impl.api.Under3
4945
import org.jetbrains.kotlinx.dataframe.plugin.impl.api.Under4
5046
import org.jetbrains.kotlinx.dataframe.plugin.impl.api.Ungroup0
5147
import org.jetbrains.kotlinx.dataframe.plugin.impl.api.With0
@@ -306,12 +302,8 @@ internal inline fun <reified T> String.load(): T {
306302
"Explode0" -> Explode0()
307303
"Insert0" -> Insert0()
308304
"Insert1" -> Insert1()
309-
"Insert2" -> Insert2()
310-
"Insert3" -> Insert3()
311305
"Under0" -> Under0()
312306
"Under1" -> Under1()
313-
"Under2" -> Under2()
314-
"Under3" -> Under3()
315307
"Under4" -> Under4()
316308
"InsertAfter0" -> InsertAfter0()
317309
"Join0" -> Join0()

0 commit comments

Comments
 (0)