Skip to content

Commit

Permalink
Drop assertor dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Oct 22, 2024
1 parent 726c295 commit 31d6aec
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ arrow-ipc = { version = "53.1.0", default-features = false, features = [
arrow-ord = { version = "53.1.0", default-features = false }
arrow-schema = { version = "53.1.0", default-features = false }
arrow-string = { version = "53.1.0", default-features = false }
assertor = "0.0.3"
async-trait = "0.1.73"
bigdecimal = "=0.4.1"
bytes = "1.4"
Expand Down
1 change: 0 additions & 1 deletion datafusion/physical-plan/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ rand = { workspace = true }
tokio = { workspace = true }

[dev-dependencies]
assertor = { workspace = true }
datafusion-functions-aggregate = { workspace = true }
rstest = { workspace = true }
rstest_reuse = "0.7.0"
Expand Down
25 changes: 19 additions & 6 deletions datafusion/physical-plan/src/execution_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -929,8 +929,6 @@ mod tests {
use super::*;
use arrow_array::{DictionaryArray, Int32Array, NullArray, RunArray};
use arrow_schema::{DataType, Field, Schema, SchemaRef};
use assertor::assert_that;
use assertor::StringAssertion;
use std::any::Any;
use std::sync::Arc;

Expand Down Expand Up @@ -1100,7 +1098,8 @@ mod tests {
&vec![0],
);
assert!(result.is_err());
assert_that!(result.err().unwrap().message().as_ref()).starts_with(
assert_starts_with(
result.err().unwrap().message().as_ref(),
"Invalid batch column at '0' has null but schema specifies non-nullable",
);
Ok(())
Expand All @@ -1124,7 +1123,8 @@ mod tests {
&vec![0],
);
assert!(result.is_err());
assert_that!(result.err().unwrap().message().as_ref()).starts_with(
assert_starts_with(
result.err().unwrap().message().as_ref(),
"Invalid batch column at '0' has null but schema specifies non-nullable",
);
Ok(())
Expand All @@ -1147,7 +1147,8 @@ mod tests {
&vec![0],
);
assert!(result.is_err());
assert_that!(result.err().unwrap().message().as_ref()).starts_with(
assert_starts_with(
result.err().unwrap().message().as_ref(),
"Invalid batch column at '0' has null but schema specifies non-nullable",
);
Ok(())
Expand Down Expand Up @@ -1189,9 +1190,21 @@ mod tests {
&vec![0],
);
assert!(result.is_err());
assert_that!(result.err().unwrap().message().as_ref()).starts_with(
assert_starts_with(
result.err().unwrap().message().as_ref(),
"Invalid batch column at '0' has null but schema specifies non-nullable",
);
Ok(())
}

fn assert_starts_with(actual: impl AsRef<str>, expected_prefix: impl AsRef<str>) {
let actual = actual.as_ref();
let expected_prefix = expected_prefix.as_ref();
assert!(
actual.starts_with(expected_prefix),
"Expected '{}' to start with '{}'",
actual,
expected_prefix
);
}
}

0 comments on commit 31d6aec

Please sign in to comment.