|
1 | 1 | import io.kotest.matchers.shouldBe
|
2 | 2 | import org.jetbrains.kotlinx.dataframe.AnyFrame
|
3 | 3 | import org.jetbrains.kotlinx.dataframe.DataColumn
|
4 |
| -import org.jetbrains.kotlinx.dataframe.api.forEach |
5 | 4 | import org.jetbrains.kotlinx.dataframe.api.forEachIndexed
|
6 | 5 | import java.math.BigInteger
|
7 | 6 | import java.time.LocalDate
|
8 | 7 | import java.time.LocalDateTime
|
| 8 | +import java.time.LocalTime |
9 | 9 | import java.time.ZoneOffset
|
10 | 10 | import kotlin.math.absoluteValue
|
11 | 11 | import kotlin.math.pow
|
@@ -118,9 +118,28 @@ internal fun assertEstimations(exampleFrame: AnyFrame) {
|
118 | 118 | element shouldBe LocalDateTime.ofEpochSecond(iBatch(i).toLong() * 60 * 60 * 24 * 30, 0, ZoneOffset.UTC)
|
119 | 119 | }
|
120 | 120 |
|
121 |
| - val timeSecCol = exampleFrame["time32_seconds"] |
122 |
| - val timeMilliCol = exampleFrame["time32_milli"] |
| 121 | + val timeSecCol = exampleFrame["time32_seconds"] as DataColumn<LocalTime?> |
| 122 | + timeSecCol.type() shouldBe typeOf<LocalTime?>() |
| 123 | + timeSecCol.forEachIndexed { i, element -> |
| 124 | + element shouldBe LocalTime.ofSecondOfDay(iBatch(i).toLong()) |
| 125 | + } |
| 126 | + |
| 127 | + val timeMilliCol = exampleFrame["time32_milli"] as DataColumn<LocalTime?> |
| 128 | + timeMilliCol.type() shouldBe typeOf<LocalTime?>() |
| 129 | + timeMilliCol.forEachIndexed { i, element -> |
| 130 | + element shouldBe LocalTime.ofNanoOfDay(iBatch(i).toLong() * 1000_000) |
| 131 | + } |
| 132 | + |
| 133 | + val timeMicroCol = exampleFrame["time64_micro"] as DataColumn<LocalTime?> |
| 134 | + timeMicroCol.type() shouldBe typeOf<LocalTime?>() |
| 135 | + timeMicroCol.forEachIndexed { i, element -> |
| 136 | + element shouldBe LocalTime.ofNanoOfDay(iBatch(i).toLong() * 1000) |
| 137 | + } |
| 138 | + |
| 139 | + val timeNanoCol = exampleFrame["time64_nano"] as DataColumn<LocalTime?> |
| 140 | + timeNanoCol.type() shouldBe typeOf<LocalTime?>() |
| 141 | + timeNanoCol.forEachIndexed { i, element -> |
| 142 | + element shouldBe LocalTime.ofNanoOfDay(iBatch(i).toLong()) |
| 143 | + } |
123 | 144 |
|
124 |
| - val timeMicroCol = exampleFrame["time64_micro"] |
125 |
| - val timeNanoCol = exampleFrame["time64_nano"] |
126 | 145 | }
|
0 commit comments