@@ -23,6 +23,10 @@ import org.jetbrains.kotlinx.dataframe.impl.columns.singleOrNullWithTransformerI
23
23
import org.jetbrains.kotlinx.dataframe.impl.columns.transform
24
24
import org.jetbrains.kotlinx.dataframe.nrow
25
25
import org.jetbrains.kotlinx.dataframe.util.DEPRECATED_ACCESS_API
26
+ import org.jetbrains.kotlinx.dataframe.util.SINGLE
27
+ import org.jetbrains.kotlinx.dataframe.util.SINGLE_COL_REPLACE
28
+ import org.jetbrains.kotlinx.dataframe.util.SINGLE_PLAIN_REPLACE
29
+ import org.jetbrains.kotlinx.dataframe.util.SINGLE_SET_REPLACE
26
30
import kotlin.reflect.KProperty
27
31
28
32
// region DataColumn
@@ -67,20 +71,18 @@ public interface SingleColumnsSelectionDsl {
67
71
* {@include [DslGrammarTemplate.ColumnSetDef]}
68
72
* {@include [LineBreak]}
69
73
* {@include [DslGrammarTemplate.ColumnGroupDef]}
70
- * {@include [LineBreak]}
71
- * {@include [DslGrammarTemplate.ConditionDef]}
72
74
* }
73
75
*
74
76
* {@set [DslGrammarTemplate.PLAIN_DSL_FUNCTIONS]
75
- * {@include [PlainDslName]}` [ `**`{ `**{@include [DslGrammarTemplate.ConditionRef]}**` \}`**` ] `
77
+ * {@include [PlainDslName]}`() `
76
78
* }
77
79
*
78
80
* {@set [DslGrammarTemplate.COLUMN_SET_FUNCTIONS]
79
- * {@include [Indent]}{@include [ColumnSetName]}` [ `**`{ `**{@include [DslGrammarTemplate.ConditionRef]}**` \}`**` ] `
81
+ * {@include [Indent]}{@include [ColumnSetName]}`() `
80
82
* }
81
83
*
82
84
* {@set [DslGrammarTemplate.COLUMN_GROUP_FUNCTIONS]
83
- * {@include [Indent]}{@include [ColumnGroupName]}` [ `**`{ `**{@include [DslGrammarTemplate.ConditionRef]}**` \}`**` ] `
85
+ * {@include [Indent]}{@include [ColumnGroupName]}`() `
84
86
* }
85
87
*/
86
88
public interface Grammar {
@@ -135,7 +137,11 @@ public interface SingleColumnsSelectionDsl {
135
137
* `df.`[select][DataFrame.select]` { `[colsOf][SingleColumn.colsOf]`<`[Int][Int]`>().`[single][ColumnSet.single]`() }`
136
138
*/
137
139
@Interpretable(" Single0" )
138
- @Deprecated(" " , ReplaceWith (" this.filter(condition).single()" ))
140
+ @Deprecated(
141
+ message = SINGLE ,
142
+ replaceWith = ReplaceWith (SINGLE_SET_REPLACE ),
143
+ level = DeprecationLevel .WARNING ,
144
+ )
139
145
public fun <C > ColumnSet<C>.single (condition : ColumnFilter <C > = { true }): TransformableSingleColumn <C > =
140
146
singleInternal(condition)
141
147
@@ -156,7 +162,11 @@ public interface SingleColumnsSelectionDsl {
156
162
* `df.`[select][DataFrame.select]` { `[single][ColumnsSelectionDsl.single]` { it.`[name][ColumnReference.name]`().`[startsWith][String.startsWith]`("year") } }`
157
163
*/
158
164
@Interpretable(" Single1" )
159
- @Deprecated(" " , ReplaceWith (" cols().filter(condition).single()" ))
165
+ @Deprecated(
166
+ message = SINGLE ,
167
+ replaceWith = ReplaceWith (SINGLE_PLAIN_REPLACE ),
168
+ level = DeprecationLevel .WARNING ,
169
+ )
160
170
public fun ColumnsSelectionDsl <* >.single (condition : ColumnFilter <* > = { true }): TransformableSingleColumn <* > =
161
171
asSingleColumn().singleCol(condition)
162
172
@@ -176,7 +186,11 @@ public interface SingleColumnsSelectionDsl {
176
186
* `df.`[select][DataFrame.select]` { myColumnGroup.`[singleCol][SingleColumn.singleCol]`() }`
177
187
*/
178
188
@Interpretable(" Single2" )
179
- @Deprecated(" " , ReplaceWith (" this.cols().filter(condition).single()" ))
189
+ @Deprecated(
190
+ message = SINGLE ,
191
+ replaceWith = ReplaceWith (SINGLE_COL_REPLACE ),
192
+ level = DeprecationLevel .WARNING ,
193
+ )
180
194
public fun SingleColumn <DataRow <* >>.singleCol (condition : ColumnFilter <* > = { true }): TransformableSingleColumn <* > =
181
195
this .ensureIsColumnGroup().asColumnSet().single(condition)
182
196
@@ -195,7 +209,11 @@ public interface SingleColumnsSelectionDsl {
195
209
* @set [CommonSingleDocs.Examples]
196
210
* `df.`[select][DataFrame.select]` { "myColumnGroup".`[singleCol][String.singleCol]` { it.`[name][ColumnReference.name]`().`[startsWith][String.startsWith]`("year") } }`
197
211
*/
198
- @Deprecated(" " , ReplaceWith (" this.cols().filter(condition).single()" ))
212
+ @Deprecated(
213
+ message = SINGLE ,
214
+ replaceWith = ReplaceWith (SINGLE_COL_REPLACE ),
215
+ level = DeprecationLevel .WARNING ,
216
+ )
199
217
public fun String.singleCol (condition : ColumnFilter <* > = { true }): TransformableSingleColumn <* > =
200
218
columnGroup(this ).singleCol(condition)
201
219
0 commit comments