@@ -17,16 +17,22 @@ import org.jetbrains.kotlinx.dataframe.indices
17
17
import org.jetbrains.kotlinx.dataframe.ncol
18
18
import org.jetbrains.kotlinx.dataframe.nrow
19
19
import org.jetbrains.kotlinx.dataframe.util.DEPRECATED_ACCESS_API
20
- import org.jetbrains.kotlinx.dataframe.util.MESSAGE_SHORTCUT_1_0
20
+ import org.jetbrains.kotlinx.dataframe.util.MESSAGE_SHORTCUT
21
+ import org.jetbrains.kotlinx.dataframe.util.IS_EMPTY_REPLACE
22
+ import org.jetbrains.kotlinx.dataframe.util.IS_NOT_EMPTY_REPLACE
23
+ import org.jetbrains.kotlinx.dataframe.util.GET_ROW_REPLACE
24
+ import org.jetbrains.kotlinx.dataframe.util.GET_ROWS_ITERABLE_REPLACE
25
+ import org.jetbrains.kotlinx.dataframe.util.GET_ROWS_RANGE_REPLACE
26
+ import org.jetbrains.kotlinx.dataframe.util.GET_ROW_OR_NULL_REPLACE
21
27
import kotlin.experimental.ExperimentalTypeInference
22
28
import kotlin.reflect.KProperty
23
29
import kotlin.reflect.KType
24
30
25
- @Deprecated(MESSAGE_SHORTCUT_1_0 , ReplaceWith (" values().all { it == null } " ) , DeprecationLevel .ERROR )
31
+ @Deprecated(MESSAGE_SHORTCUT , ReplaceWith (IS_EMPTY_REPLACE ) , DeprecationLevel .WARNING )
26
32
public fun AnyRow.isEmpty (): Boolean = owner.columns().all { it[index] == null }
27
33
28
34
@Suppress(" DEPRECATION_ERROR" )
29
- @Deprecated(MESSAGE_SHORTCUT_1_0 , ReplaceWith (" values().any { it != null } " ) , DeprecationLevel .ERROR )
35
+ @Deprecated(MESSAGE_SHORTCUT , ReplaceWith (IS_NOT_EMPTY_REPLACE ) , DeprecationLevel .WARNING )
30
36
public fun AnyRow.isNotEmpty (): Boolean = ! isEmpty()
31
37
32
38
public inline fun <reified R > AnyRow.valuesOf (): List <R > = values().filterIsInstance<R >()
@@ -180,16 +186,16 @@ public fun AnyRow.columnNames(): List<String> = df().columnNames()
180
186
public fun AnyRow.columnTypes (): List <KType > = df().columnTypes()
181
187
182
188
@Suppress(" DEPRECATION_ERROR" )
183
- @Deprecated(MESSAGE_SHORTCUT_1_0 , ReplaceWith (" df().getRow(index) " ) , DeprecationLevel .ERROR )
189
+ @Deprecated(MESSAGE_SHORTCUT , ReplaceWith (GET_ROW_REPLACE ) , DeprecationLevel .WARNING )
184
190
public fun <T > DataRow<T>.getRow (index : Int ): DataRow <T > = getRowOrNull(index)!!
185
191
186
- @Deprecated(MESSAGE_SHORTCUT_1_0 , ReplaceWith (" df().getRows(indices) " ) , DeprecationLevel .ERROR )
192
+ @Deprecated(MESSAGE_SHORTCUT , ReplaceWith (GET_ROWS_ITERABLE_REPLACE ) , DeprecationLevel .WARNING )
187
193
public fun <T > DataRow<T>.getRows (indices : Iterable <Int >): DataFrame <T > = df().getRows(indices)
188
194
189
- @Deprecated(MESSAGE_SHORTCUT_1_0 , ReplaceWith (" df().getRows(indices) " ) , DeprecationLevel .ERROR )
195
+ @Deprecated(MESSAGE_SHORTCUT , ReplaceWith (GET_ROWS_RANGE_REPLACE ) , DeprecationLevel .WARNING )
190
196
public fun <T > DataRow<T>.getRows (indices : IntRange ): DataFrame <T > = df().getRows(indices)
191
197
192
- @Deprecated(MESSAGE_SHORTCUT_1_0 , ReplaceWith (" df().getRowOrNull(index) " ) , DeprecationLevel .ERROR )
198
+ @Deprecated(MESSAGE_SHORTCUT , ReplaceWith (GET_ROW_OR_NULL_REPLACE ) , DeprecationLevel .WARNING )
193
199
public fun <T > DataRow<T>.getRowOrNull (index : Int ): DataRow <T >? {
194
200
val df = df()
195
201
return if (index >= 0 && index < df.nrow) df[index] else null
0 commit comments