Skip to content

Commit 7d84d17

Browse files
committed
Removed UpdateException
1 parent f1a13c6 commit 7d84d17

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import org.jetbrains.kotlinx.dataframe.api.with
2323
import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup
2424
import org.jetbrains.kotlinx.dataframe.columns.FrameColumn
2525
import org.jetbrains.kotlinx.dataframe.columns.size
26-
import org.jetbrains.kotlinx.dataframe.exceptions.DataFrameError
2726
import org.jetbrains.kotlinx.dataframe.impl.columns.AddDataRowImpl
2827
import org.jetbrains.kotlinx.dataframe.impl.createDataCollector
2928
import org.jetbrains.kotlinx.dataframe.index
@@ -95,10 +94,6 @@ private fun <C, R> ColumnGroup<C>.replaceRowsIf(
9594
.asColumnGroup()
9695
.cast()
9796

98-
public class UpdateException(override val message: String, cause: Throwable? = null) :
99-
IllegalStateException(message, cause),
100-
DataFrameError
101-
10297
internal fun <T, C> DataColumn<C>.updateImpl(
10398
df: DataFrame<T>,
10499
filter: RowValueFilter<T, C>?,
@@ -123,7 +118,7 @@ internal fun <T, C> DataColumn<C>.updateImpl(
123118
}
124119
return collector.toColumn(src.name).cast()
125120
} catch (e: Throwable) {
126-
throw UpdateException("Could not update column '${src.name}': ${e.message}", e)
121+
throw IllegalStateException("Could not update column '${src.name}': ${e.message}", e)
127122
}
128123
}
129124

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import io.kotest.matchers.shouldBe
55
import org.jetbrains.kotlinx.dataframe.DataColumn
66
import org.jetbrains.kotlinx.dataframe.DataFrame
77
import org.jetbrains.kotlinx.dataframe.annotations.DataSchema
8-
import org.jetbrains.kotlinx.dataframe.impl.api.UpdateException
98
import org.jetbrains.kotlinx.dataframe.impl.nothingType
109
import org.jetbrains.kotlinx.dataframe.impl.nullableNothingType
1110
import org.jetbrains.kotlinx.dataframe.size
@@ -101,7 +100,7 @@ class UpdateTests {
101100
.schema() shouldBe nullFilledDf.schema()
102101

103102
// or 'Nothing', aka, return early/throw exception
104-
shouldThrow<UpdateException> {
103+
shouldThrow<IllegalStateException> {
105104
nullFilledDf.update { "a"<Nothing?>() }.with { error("Nothing") }
106105
}.cause!!.message shouldBe "Nothing"
107106
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ import org.jetbrains.kotlinx.dataframe.get
168168
import org.jetbrains.kotlinx.dataframe.hasNulls
169169
import org.jetbrains.kotlinx.dataframe.impl.DataFrameImpl
170170
import org.jetbrains.kotlinx.dataframe.impl.DataFrameSize
171-
import org.jetbrains.kotlinx.dataframe.impl.api.UpdateException
172171
import org.jetbrains.kotlinx.dataframe.impl.api.convertToImpl
173172
import org.jetbrains.kotlinx.dataframe.impl.between
174173
import org.jetbrains.kotlinx.dataframe.impl.columns.isMissingColumn
@@ -1713,7 +1712,7 @@ class DataFrameTests : BaseTest() {
17131712
df.update("name").at(0).with { "ALICE" }
17141713
}
17151714

1716-
@Test(expected = UpdateException::class)
1715+
@Test(expected = IllegalStateException::class)
17171716
fun `update with wrong type`() {
17181717
typed.update("age").with { "string" }
17191718
}

0 commit comments

Comments
 (0)