Skip to content

Commit c4b3da7

Browse files
committed
removed allColsExcept infix overloads
1 parent 9e433d5 commit c4b3da7

File tree

4 files changed

+56
-128
lines changed
  • core
    • generated-sources/src
    • src

4 files changed

+56
-128
lines changed

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt

Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -216,24 +216,15 @@ public interface AllExceptColumnsSelectionDsl<out T> {
216216

217217
// region SingleColumn
218218

219-
public infix fun <C> SingleColumn<DataRow<C>>.allColsExcept(selector: ColumnsSelector<C, *>): ColumnSet<*> =
219+
public fun <C> SingleColumn<DataRow<C>>.allColsExcept(selector: ColumnsSelector<C, *>): ColumnSet<*> =
220220
allColsExceptInternal(selector.toColumns())
221221

222-
public infix fun SingleColumn<DataRow<*>>.allColsExcept(other: ColumnsResolver<*>): ColumnSet<*> =
223-
allColsExceptInternal(other)
224-
225222
public fun SingleColumn<DataRow<*>>.allColsExcept(vararg other: ColumnsResolver<*>): ColumnSet<*> =
226-
allColsExcept(other.toColumnSet())
227-
228-
public infix fun SingleColumn<DataRow<*>>.allColsExcept(other: String): ColumnSet<*> =
229-
allColsExcept(column<Any?>(other))
223+
allColsExceptInternal(other.toColumnSet())
230224

231225
public fun SingleColumn<DataRow<*>>.allColsExcept(vararg others: String): ColumnSet<*> =
232226
allColsExcept(others.toColumnSet())
233227

234-
public infix fun SingleColumn<DataRow<*>>.allColsExcept(other: KProperty<*>): ColumnSet<*> =
235-
allColsExcept(column(other))
236-
237228
public fun SingleColumn<DataRow<*>>.allColsExcept(vararg others: KProperty<*>): ColumnSet<*> =
238229
allColsExcept(others.toColumnSet())
239230

@@ -246,21 +237,12 @@ public interface AllExceptColumnsSelectionDsl<out T> {
246237
public fun String.allColsExcept(selector: ColumnsSelector<*, *>): ColumnSet<*> =
247238
columnGroup(this).allColsExcept(selector)
248239

249-
public infix fun String.allColsExcept(other: ColumnsResolver<*>): ColumnSet<*> =
250-
columnGroup(this).allColsExcept(other)
251-
252240
public fun String.allColsExcept(vararg others: ColumnsResolver<*>): ColumnSet<*> =
253-
allColsExcept(others.toColumnSet())
254-
255-
public fun String.allColsExcept(other: String): ColumnSet<*> =
256-
columnGroup(this).allColsExcept(other)
241+
columnGroup(this).allColsExcept(others.toColumnSet())
257242

258243
public fun String.allColsExcept(vararg others: String): ColumnSet<*> =
259244
allColsExcept(others.toColumnSet())
260245

261-
public fun String.allColsExcept(other: KProperty<*>): ColumnSet<*> =
262-
columnGroup(this).allColsExcept(other)
263-
264246
public fun String.allColsExcept(vararg others: KProperty<*>): ColumnSet<*> =
265247
allColsExcept(others.toColumnSet())
266248

@@ -271,21 +253,12 @@ public interface AllExceptColumnsSelectionDsl<out T> {
271253
public fun <C> KProperty<DataRow<C>>.allColsExcept(selector: ColumnsSelector<C, *>): ColumnSet<*> =
272254
columnGroup(this).allColsExcept(selector)
273255

274-
public infix fun KProperty<*>.allColsExcept(other: ColumnsResolver<*>): ColumnSet<*> =
275-
columnGroup(this).allColsExcept(other)
276-
277256
public fun KProperty<*>.allColsExcept(vararg others: ColumnsResolver<*>): ColumnSet<*> =
278-
allColsExcept(others.toColumnSet())
279-
280-
public infix fun KProperty<*>.allColsExcept(other: String): ColumnSet<*> =
281-
columnGroup(this).allColsExcept(other)
257+
columnGroup(this).allColsExcept(others.toColumnSet())
282258

283259
public fun KProperty<*>.allColsExcept(vararg others: String): ColumnSet<*> =
284260
allColsExcept(others.toColumnSet())
285261

286-
public infix fun KProperty<*>.allColsExcept(other: KProperty<*>): ColumnSet<*> =
287-
columnGroup(this).allColsExcept(other)
288-
289262
public fun KProperty<*>.allColsExcept(vararg others: KProperty<*>): ColumnSet<*> =
290263
allColsExcept(others.toColumnSet())
291264

@@ -296,21 +269,12 @@ public interface AllExceptColumnsSelectionDsl<out T> {
296269
public fun ColumnPath.allColsExcept(selector: ColumnsSelector<*, *>): ColumnSet<*> =
297270
columnGroup(this).allColsExcept(selector)
298271

299-
public infix fun ColumnPath.allColsExcept(other: ColumnsResolver<*>): ColumnSet<*> =
300-
columnGroup(this).allColsExcept(other)
301-
302272
public fun ColumnPath.allColsExcept(vararg others: ColumnsResolver<*>): ColumnSet<*> =
303-
allColsExcept(others.toColumnSet())
304-
305-
public infix fun ColumnPath.allColsExcept(other: String): ColumnSet<*> =
306-
columnGroup(this).allColsExcept(other)
273+
columnGroup(this).allColsExcept(others.toColumnSet())
307274

308275
public fun ColumnPath.allColsExcept(vararg others: String): ColumnSet<*> =
309276
allColsExcept(others.toColumnSet())
310277

311-
public infix fun ColumnPath.allColsExcept(other: KProperty<*>): ColumnSet<*> =
312-
columnGroup(this).allColsExcept(other)
313-
314278
public fun ColumnPath.allColsExcept(vararg others: KProperty<*>): ColumnSet<*> =
315279
allColsExcept(others.toColumnSet())
316280

core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/api/allExcept.kt

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -111,38 +111,38 @@ class AllExceptTests : ColumnsSelectionDslTests() {
111111
dfGroup.remove { name.firstName.secondName }.select { name.allCols() }.alsoDebug(),
112112

113113
dfGroup.select {
114-
name allColsExcept "name"["firstName"]["secondName"]
114+
name.allColsExcept("name"["firstName"]["secondName"])
115115
},
116116
dfGroup.select {
117-
name allColsExcept (name.firstName.secondName and name.firstName.secondName)
117+
name.allColsExcept(name.firstName.secondName and name.firstName.secondName)
118118
},
119119
dfGroup.select {
120-
name allColsExcept colGroup("firstName").col("secondName")
120+
name.allColsExcept(colGroup("firstName").col("secondName"))
121121
},
122122
).shouldAllBeEqual()
123123

124124
listOf(
125125
dfGroup.remove { name.firstName.secondName }.select { name.firstName.allCols() }.alsoDebug(),
126126

127127
dfGroup.select {
128-
name.firstName allColsExcept "secondName"
128+
name.firstName.allColsExcept("secondName")
129129
},
130130
dfGroup.select {
131-
name.firstName allColsExcept name.firstName.secondName
131+
name.firstName.allColsExcept(name.firstName.secondName)
132132
},
133133
dfGroup.select {
134-
name.firstName allColsExcept pathOf("name", "firstName", "secondName")
134+
name.firstName.allColsExcept(pathOf("name", "firstName", "secondName"))
135135
},
136136
dfGroup.select {
137-
name.firstName allColsExcept pathOf("secondName")
137+
name.firstName.allColsExcept(pathOf("secondName"))
138138
},
139139
).shouldAllBeEqual()
140140

141141
listOf(
142142
dfGroup.select { name.firstName { secondName and thirdName } },
143-
dfGroup.select { name { firstName allColsExcept "firstName" } }.alsoDebug(),
144-
dfGroup.select { name { firstName allColsExcept pathOf("firstName") } }.alsoDebug(),
145-
dfGroup.select { (name allColsExcept "firstName"["firstName"]).first().asColumnGroup().allCols() },
143+
dfGroup.select { name { firstName.allColsExcept("firstName") } }.alsoDebug(),
144+
dfGroup.select { name { firstName.allColsExcept(pathOf("firstName")) } }.alsoDebug(),
145+
dfGroup.select { (name.allColsExcept("firstName"["firstName"])).first().asColumnGroup().allCols() },
146146
dfGroup.remove { name.firstName.firstName }.select { name.firstName.allCols() },
147147
).shouldAllBeEqual()
148148
}
@@ -160,13 +160,13 @@ class AllExceptTests : ColumnsSelectionDslTests() {
160160
// firstName allColsExcept firstName.firstName
161161
// }
162162
// }.alsoDebug()
163-
TODO()
164-
dfGroup.select { name { firstName allColsExcept firstName.firstName } }.alsoDebug() // should work
165-
dfGroup.select { name { firstName allColsExcept firstName } }.alsoDebug() // should fail
163+
164+
dfGroup.select { name { firstName.allColsExcept(firstName.firstName) } }.alsoDebug() // should work
165+
dfGroup.select { name { firstName.allColsExcept(firstName) } }.alsoDebug() // should fail
166166

167167
shouldThrow<IllegalArgumentException> {
168168
dfGroup.select {
169-
name.firstName allColsExcept "firstName"["secondName"]
169+
name.firstName.allColsExcept("firstName"["secondName"])
170170
}
171171
}
172172

@@ -197,16 +197,16 @@ class AllExceptTests : ColumnsSelectionDslTests() {
197197
df.select { name.allColsExcept(Name::lastName, Name::lastName) },
198198
df.select { name.allColsExcept(pathOf("lastName"), pathOf("lastName")) },
199199

200-
df.select { name allColsExcept name.lastName },
201-
df.select { name allColsExcept (name.lastName and name.lastName) },
200+
df.select { name.allColsExcept(name.lastName) },
201+
df.select { name.allColsExcept(name.lastName and name.lastName) },
202202
// df.select { name allColsExcept (name.lastName and "lastName") },//
203203
df.select { name.allCols() except name.lastName },
204-
df.select { name allColsExcept fullLastNameAccessor },
204+
df.select { name.allColsExcept(fullLastNameAccessor) },
205205
df.select { name.allCols() except fullLastNameAccessor },
206206

207-
df.select { name allColsExcept "lastName" },
208-
df.select { name allColsExcept Name::lastName },
209-
df.select { name allColsExcept pathOf("lastName") },
207+
df.select { name.allColsExcept("lastName") },
208+
df.select { name.allColsExcept(Name::lastName) },
209+
df.select { name.allColsExcept(pathOf("lastName")) },
210210
).shouldAllBeEqual()
211211
}
212212

@@ -222,9 +222,9 @@ class AllExceptTests : ColumnsSelectionDslTests() {
222222
dfGroup.select { name.firstName.allColsExcept { secondNameAccessor and thirdNameAccessor } },
223223
dfGroup.select { name.firstName.allColsExcept { cols { it.name in listOf("secondName", "thirdName") } } },
224224
dfGroup.select { name.firstName.allColsExcept(name.firstName.secondName and name.firstName.thirdName) },
225-
dfGroup.select { name.firstName allColsExcept (name.firstName.secondName and name.firstName.thirdName) },
226-
dfGroup.select { name.firstName allColsExcept (name.firstName.secondName and thirdNameAccessor) },
227-
dfGroup.select { name.firstName allColsExcept (secondNameAccessor and thirdNameAccessor) },
225+
dfGroup.select { name.firstName.allColsExcept(name.firstName.secondName and name.firstName.thirdName) },
226+
dfGroup.select { name.firstName.allColsExcept(name.firstName.secondName and thirdNameAccessor) },
227+
dfGroup.select { name.firstName.allColsExcept(secondNameAccessor and thirdNameAccessor) },
228228
).shouldAllBeEqual()
229229
}
230230

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

Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -170,24 +170,15 @@ public interface AllExceptColumnsSelectionDsl<out T> {
170170

171171
// region SingleColumn
172172

173-
public infix fun <C> SingleColumn<DataRow<C>>.allColsExcept(selector: ColumnsSelector<C, *>): ColumnSet<*> =
173+
public fun <C> SingleColumn<DataRow<C>>.allColsExcept(selector: ColumnsSelector<C, *>): ColumnSet<*> =
174174
allColsExceptInternal(selector.toColumns())
175175

176-
public infix fun SingleColumn<DataRow<*>>.allColsExcept(other: ColumnsResolver<*>): ColumnSet<*> =
177-
allColsExceptInternal(other)
178-
179176
public fun SingleColumn<DataRow<*>>.allColsExcept(vararg other: ColumnsResolver<*>): ColumnSet<*> =
180-
allColsExcept(other.toColumnSet())
181-
182-
public infix fun SingleColumn<DataRow<*>>.allColsExcept(other: String): ColumnSet<*> =
183-
allColsExcept(column<Any?>(other))
177+
allColsExceptInternal(other.toColumnSet())
184178

185179
public fun SingleColumn<DataRow<*>>.allColsExcept(vararg others: String): ColumnSet<*> =
186180
allColsExcept(others.toColumnSet())
187181

188-
public infix fun SingleColumn<DataRow<*>>.allColsExcept(other: KProperty<*>): ColumnSet<*> =
189-
allColsExcept(column(other))
190-
191182
public fun SingleColumn<DataRow<*>>.allColsExcept(vararg others: KProperty<*>): ColumnSet<*> =
192183
allColsExcept(others.toColumnSet())
193184

@@ -200,21 +191,12 @@ public interface AllExceptColumnsSelectionDsl<out T> {
200191
public fun String.allColsExcept(selector: ColumnsSelector<*, *>): ColumnSet<*> =
201192
columnGroup(this).allColsExcept(selector)
202193

203-
public infix fun String.allColsExcept(other: ColumnsResolver<*>): ColumnSet<*> =
204-
columnGroup(this).allColsExcept(other)
205-
206194
public fun String.allColsExcept(vararg others: ColumnsResolver<*>): ColumnSet<*> =
207-
allColsExcept(others.toColumnSet())
208-
209-
public fun String.allColsExcept(other: String): ColumnSet<*> =
210-
columnGroup(this).allColsExcept(other)
195+
columnGroup(this).allColsExcept(others.toColumnSet())
211196

212197
public fun String.allColsExcept(vararg others: String): ColumnSet<*> =
213198
allColsExcept(others.toColumnSet())
214199

215-
public fun String.allColsExcept(other: KProperty<*>): ColumnSet<*> =
216-
columnGroup(this).allColsExcept(other)
217-
218200
public fun String.allColsExcept(vararg others: KProperty<*>): ColumnSet<*> =
219201
allColsExcept(others.toColumnSet())
220202

@@ -225,21 +207,12 @@ public interface AllExceptColumnsSelectionDsl<out T> {
225207
public fun <C> KProperty<DataRow<C>>.allColsExcept(selector: ColumnsSelector<C, *>): ColumnSet<*> =
226208
columnGroup(this).allColsExcept(selector)
227209

228-
public infix fun KProperty<*>.allColsExcept(other: ColumnsResolver<*>): ColumnSet<*> =
229-
columnGroup(this).allColsExcept(other)
230-
231210
public fun KProperty<*>.allColsExcept(vararg others: ColumnsResolver<*>): ColumnSet<*> =
232-
allColsExcept(others.toColumnSet())
233-
234-
public infix fun KProperty<*>.allColsExcept(other: String): ColumnSet<*> =
235-
columnGroup(this).allColsExcept(other)
211+
columnGroup(this).allColsExcept(others.toColumnSet())
236212

237213
public fun KProperty<*>.allColsExcept(vararg others: String): ColumnSet<*> =
238214
allColsExcept(others.toColumnSet())
239215

240-
public infix fun KProperty<*>.allColsExcept(other: KProperty<*>): ColumnSet<*> =
241-
columnGroup(this).allColsExcept(other)
242-
243216
public fun KProperty<*>.allColsExcept(vararg others: KProperty<*>): ColumnSet<*> =
244217
allColsExcept(others.toColumnSet())
245218

@@ -250,21 +223,12 @@ public interface AllExceptColumnsSelectionDsl<out T> {
250223
public fun ColumnPath.allColsExcept(selector: ColumnsSelector<*, *>): ColumnSet<*> =
251224
columnGroup(this).allColsExcept(selector)
252225

253-
public infix fun ColumnPath.allColsExcept(other: ColumnsResolver<*>): ColumnSet<*> =
254-
columnGroup(this).allColsExcept(other)
255-
256226
public fun ColumnPath.allColsExcept(vararg others: ColumnsResolver<*>): ColumnSet<*> =
257-
allColsExcept(others.toColumnSet())
258-
259-
public infix fun ColumnPath.allColsExcept(other: String): ColumnSet<*> =
260-
columnGroup(this).allColsExcept(other)
227+
columnGroup(this).allColsExcept(others.toColumnSet())
261228

262229
public fun ColumnPath.allColsExcept(vararg others: String): ColumnSet<*> =
263230
allColsExcept(others.toColumnSet())
264231

265-
public infix fun ColumnPath.allColsExcept(other: KProperty<*>): ColumnSet<*> =
266-
columnGroup(this).allColsExcept(other)
267-
268232
public fun ColumnPath.allColsExcept(vararg others: KProperty<*>): ColumnSet<*> =
269233
allColsExcept(others.toColumnSet())
270234

0 commit comments

Comments
 (0)