Skip to content

Commit 86a4630

Browse files
util functions fix
1 parent c11d770 commit 86a4630

File tree

6 files changed

+10
-22
lines changed

6 files changed

+10
-22
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public fun <T> DataColumn<T>.any(predicate: Predicate<T>): Boolean = values.any(
4141
* @param predicate A [RowFilter] lambda that takes a [DataRow] (as both `this` and `it`)
4242
* and returns `true` if the row should be considered a match.
4343
* @return `true` if at least one row satisfies the [predicate], `false` otherwise.
44+
* @see [DataFrame.all]
4445
*/
4546
public inline fun <T> DataFrame<T>.any(predicate: RowFilter<T>): Boolean = rows().any { predicate(it, it) }
4647

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import org.jetbrains.kotlinx.dataframe.impl.between
77

88
/**
99
* Returns a [DataColumn] of [Boolean] values indicating whether each element
10-
* lies between [left] and [right].
10+
* in this column lies between [left] and [right].
1111
*
1212
* If [includeBoundaries] is `true` (default), values equal to [left] or [right] are also considered in range.
1313
*
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
package org.jetbrains.kotlinx.dataframe.api
22

33
import org.jetbrains.kotlinx.dataframe.DataFrame
4-
import org.jetbrains.kotlinx.dataframe.util.TAIL
5-
import org.jetbrains.kotlinx.dataframe.util.TAIL_REPLACE
64

75
// region DataFrame
86

9-
@Deprecated(TAIL, ReplaceWith(TAIL_REPLACE), DeprecationLevel.ERROR)
7+
/**
8+
* Returns a DataFrame containing the last [numRows] rows.
9+
*
10+
* Equivalent to [takeLast].
11+
*
12+
* @param numRows The number of rows to return from the end of the DataFrame. Defaults to 5.
13+
* @return A DataFrame containing the last [numRows] rows.
14+
*/
1015
public fun <T> DataFrame<T>.tail(numRows: Int = 5): DataFrame<T> = takeLast(numRows)
1116

1217
// endregion

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/util/deprecationMessages.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,6 @@ internal const val COL_TYPE_INSTANT =
139139
"kotlinx.datetime.Instant is deprecated in favor of kotlin.time.Instant. Either migrate to kotlin.time.Instant and use ColType.StdlibInstant or use ColType.DeprecatedInstant. $MESSAGE_1_0 and migrated to kotlin.time.Instant in 1.1."
140140
internal const val COL_TYPE_INSTANT_REPLACE = "ColType.DeprecatedInstant"
141141

142-
internal const val TAIL = "This function will be removed in favor of `takeLast()`. $MESSAGE_1_0"
143-
internal const val TAIL_REPLACE = "this.takeLast(numRows)"
144-
145142
// endregion
146143

147144
// region WARNING in 1.0, ERROR in 1.1

core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/samples/api/Create.kt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,6 @@ class Create : TestBase() {
7878
// SampleEnd
7979
}
8080

81-
// Not used anymore
82-
/*@Test
83-
@TransformDataFrameExpressions
84-
fun columnAccessorToColumn() {
85-
// SampleStart
86-
val age by column<Int>()
87-
val ageCol1 = age.withValues(15, 20)
88-
val ageCol2 = age.withValues(1..10)
89-
// SampleEnd
90-
91-
ageCol2.size() shouldBe 10
92-
}*/
93-
9481
@Test
9582
@TransformDataFrameExpressions
9683
fun columnAccessorMap() {

examples/kotlin-dataframe-plugin-example/src/main/kotlin/org/jetbrains/kotlinx/dataframe/examples/plugin/Main.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ import org.jetbrains.kotlinx.dataframe.api.add
66
import org.jetbrains.kotlinx.dataframe.api.convert
77
import org.jetbrains.kotlinx.dataframe.api.convertTo
88
import org.jetbrains.kotlinx.dataframe.api.filter
9-
import org.jetbrains.kotlinx.dataframe.api.insert
109
import org.jetbrains.kotlinx.dataframe.api.into
1110
import org.jetbrains.kotlinx.dataframe.api.rename
1211
import org.jetbrains.kotlinx.dataframe.api.renameToCamelCase
13-
import org.jetbrains.kotlinx.dataframe.api.under
1412
import org.jetbrains.kotlinx.dataframe.api.with
1513
import org.jetbrains.kotlinx.dataframe.io.readCsv
1614
import org.jetbrains.kotlinx.dataframe.io.writeCsv

0 commit comments

Comments
 (0)