MCPcopy Create free account
hub / github.com/apache/datafusion / assert_field_not_found

Function assert_field_not_found

datafusion/sql/tests/sql_integration.rs:4956–4978  ·  view source on GitHub ↗
(mut err: DataFusionError, name: &str)

Source from the content-addressed store, hash-verified

4954}
4955
4956fn assert_field_not_found(mut err: DataFusionError, name: &str) {
4957 let err = loop {
4958 match err {
4959 DataFusionError::Diagnostic(_, wrapped_err) => {
4960 err = *wrapped_err;
4961 }
4962 DataFusionError::Collection(errs) => {
4963 err = errs.into_iter().next().unwrap();
4964 }
4965 err => break err,
4966 }
4967 };
4968 match err {
4969 DataFusionError::SchemaError(_, _) => {
4970 let msg = format!("{err}");
4971 let expected = format!("Schema error: No field named {name}.");
4972 if !msg.starts_with(&expected) {
4973 panic!("error [{msg}] did not start with [{expected}]");
4974 }
4975 }
4976 _ => panic!("assert_field_not_found wrong error type"),
4977 }
4978}
4979
4980#[cfg(test)]
4981#[ctor::ctor(unsafe)]

Calls 2

nextMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…