File tree Expand file tree Collapse file tree 3 files changed +3
-10
lines changed
main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api
test/kotlin/org/jetbrains/kotlinx/dataframe Expand file tree Collapse file tree 3 files changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ import org.jetbrains.kotlinx.dataframe.api.with
2323import org.jetbrains.kotlinx.dataframe.columns.ColumnGroup
2424import org.jetbrains.kotlinx.dataframe.columns.FrameColumn
2525import org.jetbrains.kotlinx.dataframe.columns.size
26- import org.jetbrains.kotlinx.dataframe.exceptions.DataFrameError
2726import org.jetbrains.kotlinx.dataframe.impl.columns.AddDataRowImpl
2827import org.jetbrains.kotlinx.dataframe.impl.createDataCollector
2928import 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-
10297internal 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
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import io.kotest.matchers.shouldBe
55import org.jetbrains.kotlinx.dataframe.DataColumn
66import org.jetbrains.kotlinx.dataframe.DataFrame
77import org.jetbrains.kotlinx.dataframe.annotations.DataSchema
8- import org.jetbrains.kotlinx.dataframe.impl.api.UpdateException
98import org.jetbrains.kotlinx.dataframe.impl.nothingType
109import org.jetbrains.kotlinx.dataframe.impl.nullableNothingType
1110import 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 }
Original file line number Diff line number Diff line change @@ -168,7 +168,6 @@ import org.jetbrains.kotlinx.dataframe.get
168168import org.jetbrains.kotlinx.dataframe.hasNulls
169169import org.jetbrains.kotlinx.dataframe.impl.DataFrameImpl
170170import org.jetbrains.kotlinx.dataframe.impl.DataFrameSize
171- import org.jetbrains.kotlinx.dataframe.impl.api.UpdateException
172171import org.jetbrains.kotlinx.dataframe.impl.api.convertToImpl
173172import org.jetbrains.kotlinx.dataframe.impl.between
174173import 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 }
You can’t perform that action at this time.
0 commit comments