Skip to content

Commit e68b292

Browse files
committed
fixed compilation regarding explicit reified types
1 parent 283d7e1 commit e68b292

File tree

8 files changed

+14
-13
lines changed

8 files changed

+14
-13
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ class GatherTests {
143143

144144
@Test
145145
fun `gather mix of columns`() {
146-
val a by columnOf(1, 1.1)
147-
val b by columnOf(2, 2.2)
146+
val a by columnOf<Number>(1, 1.1)
147+
val b by columnOf<Number>(2, 2.2)
148148

149149
val df = dataFrameOf(a, b)[0..0]
150150

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class GetTests {
5252
val throwable = shouldThrow<IllegalArgumentException> { df[column<Int>("c")] }
5353
throwable.message shouldContain "Column not found: '[c]'"
5454

55-
val added = df.add(A::c) { "3" }[0]
55+
val added = df.add<Any, _>(A::c) { "3" }[0]
5656

5757
shouldThrow<ClassCastException> { added.getValue(c) + 1 }
5858
shouldThrow<ClassCastException> { added.getValue<Int>("c") + 1 }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class InferTypeTests {
88

99
@Test
1010
fun `infer type 1`() {
11-
val col by columnOf("Alice", 1, 3.5)
11+
val col by columnOf<Comparable<*>>("Alice", 1, 3.5)
1212
col.type() shouldBe typeOf<Comparable<*>>()
1313
val filtered = col.filter { it is String }
1414
filtered.type() shouldBe typeOf<Comparable<*>>()

core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/io/ParserTests.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ class ParserTests {
6666

6767
@Test(expected = TypeConversionException::class)
6868
fun `converter for mixed column should throw`() {
69-
val col by columnOf(1, "a")
69+
val col by columnOf<Any>(1, "a")
7070
col.convertTo<Int>()
7171
}
7272

7373
@Test
7474
fun `convert mixed column`() {
75-
val col by columnOf(1.0, "1")
75+
val col by columnOf<Any>(1.0, "1")
7676
val converted = col.convertTo<Int>()
7777
converted.type() shouldBe typeOf<Int>()
7878
converted[0] shouldBe 1
@@ -90,7 +90,7 @@ class ParserTests {
9090

9191
@Test
9292
fun `convert to Boolean`() {
93-
val col by columnOf(BigDecimal(1.0), BigDecimal(0.0), 0, 1, 10L, 0.0, 0.1)
93+
val col by columnOf<Number>(BigDecimal(1.0), BigDecimal(0.0), 0, 1, 10L, 0.0, 0.1)
9494
col.convertTo<Boolean>().shouldBe(
9595
DataColumn.createValueColumn("col", listOf(true, false, false, true, true, false, true), typeOf<Boolean>()),
9696
)

core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/puzzles/CleaningDataTests.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ class CleaningDataTests {
122122
)
123123

124124
df.convert { recentDelays }.with { it.map { d -> d.toDouble() } }
125-
.split { recentDelays }.default(Double.NaN).into { "delay_$it" }[delay1, delay2, delay3] shouldBe expected
125+
.split { recentDelays }.default<_, _, Number>(Double.NaN)
126+
.into { "delay_$it" }[delay1, delay2, delay3] shouldBe expected
126127

127128
df.convert { "RecentDelays"<List<Int>>() }.with { it.map { d -> d.toDouble() } }
128129
.split { "RecentDelays"<List<Double>>() }.default(Double.NaN).into {

core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/rendering/PrecisionTests.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ class PrecisionTests {
1616
fun precision() {
1717
columnOf(1.2, 3.2).scale() shouldBe 1
1818
columnOf(1.1232, 3.2).scale() shouldBe 4
19-
columnOf(1.1220001, 12313).scale() shouldBe DEFAULT_PRECISION
19+
columnOf<Number>(1.1220001, 12313).scale() shouldBe DEFAULT_PRECISION
2020
columnOf(1, 2).scale() shouldBe 0
21-
columnOf(1.0, 2).scale() shouldBe 1
21+
columnOf<Number>(1.0, 2).scale() shouldBe 1
2222
columnOf(123121.0, -1231.0).scale() shouldBe 1
2323
columnOf(123121.00001, -1231.120).scale() shouldBe 5
2424
columnOf(0.000343434343434343434343).scale() shouldBe DEFAULT_PRECISION

core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/testSets/person/DataFrameTests.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2351,7 +2351,7 @@ class DataFrameTests : BaseTest() {
23512351

23522352
@Test
23532353
fun splitIntoThisAndNewColumn() {
2354-
val split = typed.split { name }.by { listOf(it.dropLast(1), it.last()) }.into("name", "lastChar")
2354+
val split = typed.split { name }.by { listOf<Any>(it.dropLast(1), it.last()) }.into("name", "lastChar")
23552355
split.columnNames().sorted() shouldBe (typed.columnNames() + "lastChar").sorted()
23562356
}
23572357

core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/types/DoubleTests.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ class DoubleTests {
1212

1313
@Test
1414
fun `filter not null with nans`() {
15-
val age by columnOf(2.3, Double.NaN, 1.0, "asd", 3, 'a')
15+
val age by columnOf<Any>(2.3, Double.NaN, 1.0, "asd", 3, 'a')
1616
val df = dataFrameOf(age)
17-
df.filter { age() == Double.NaN }.nrow shouldBe 1
17+
df.filter { (age() as? Double)?.isNaN() == true }.nrow shouldBe 1
1818
df.filter { age().isNaN }.nrow shouldBe 1
1919
df.filter { it[age].isNaN }.nrow shouldBe 1
2020
}

0 commit comments

Comments
 (0)