Skip to content

Commit 98f98d1

Browse files
committed
test fix #1, errors and debug strings
1 parent ab48bb2 commit 98f98d1

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

datafusion/src/error.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,8 @@ impl From<DataFusionError> for ArrowError {
8383
fn from(e: DataFusionError) -> Self {
8484
match e {
8585
DataFusionError::ArrowError(e) => e,
86-
DataFusionError::External(e) => {
87-
ArrowError::External("datafusion".to_string(), e)
88-
}
89-
other => ArrowError::External("datafusion".to_string(), Box::new(other)),
86+
DataFusionError::External(e) => ArrowError::External("".to_string(), e),
87+
other => ArrowError::External("".to_string(), Box::new(other)),
9088
}
9189
}
9290
}
@@ -162,7 +160,10 @@ mod test {
162160
#[test]
163161
fn datafusion_error_to_arrow() {
164162
let res = return_datafusion_error().unwrap_err();
165-
assert_eq!(res.to_string(), "Arrow error: Schema error: bar");
163+
assert_eq!(
164+
res.to_string(),
165+
"Arrow error: Invalid argument error: Schema error: bar"
166+
);
166167
}
167168

168169
/// Model what happens when implementing SendableRecrordBatchStream:
@@ -179,7 +180,9 @@ mod test {
179180
#[allow(clippy::try_err)]
180181
fn return_datafusion_error() -> crate::error::Result<()> {
181182
// Expect the '?' to work
182-
let _bar = Err(ArrowError::OutOfSpec("bar".to_string()))?;
183+
let _bar = Err(ArrowError::InvalidArgumentError(
184+
"Schema error: bar".to_string(),
185+
))?;
183186
Ok(())
184187
}
185188
}

datafusion/src/logical_plan/dfschema.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,8 @@ mod tests {
535535
let schema = DFSchema::try_from_qualified_schema("t1", &test_schema_1())?;
536536
let arrow_schema: Schema = schema.into();
537537
let expected =
538-
"[Field { name: \"c0\", data_type: Boolean, nullable: true, metadata: {} }, \
539-
Field { name: \"c1\", data_type: Boolean, nullable: true, metadata: {} }]";
538+
"[Field { name: \"c0\", data_type: Boolean, is_nullable: true, metadata: {} }, \
539+
Field { name: \"c1\", data_type: Boolean, is_nullable: true, metadata: {} }]";
540540
assert_eq!(expected, format!("{:?}", arrow_schema.fields));
541541
Ok(())
542542
}

0 commit comments

Comments
 (0)