Skip to content

Commit 8d7b11b

Browse files
authored
chore: make more clarity for internal errors (#16741)
* chore: make more clarity for internal errors * chore: make more clarity for internal errors * chore: make more clarity for internal errors
1 parent 54592e8 commit 8d7b11b

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

datafusion/common/src/error.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,9 @@ impl DataFusionError {
542542
DataFusionError::Configuration(ref desc) => Cow::Owned(desc.to_string()),
543543
DataFusionError::NotImplemented(ref desc) => Cow::Owned(desc.to_string()),
544544
DataFusionError::Internal(ref desc) => Cow::Owned(format!(
545-
"{desc}.\nThis was likely caused by a bug in DataFusion's \
546-
code and we would welcome that you file an bug report in our issue tracker"
545+
"{desc}.\nThis issue was likely caused by a bug in DataFusion's code. \
546+
Please help us to resolve this by filing a bug report in our issue tracker: \
547+
https://github.com/apache/datafusion/issues"
547548
)),
548549
DataFusionError::Plan(ref desc) => Cow::Owned(desc.to_string()),
549550
DataFusionError::SchemaError(ref desc, ref backtrace) => {

datafusion/physical-expr/src/expressions/column.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ mod test {
204204
use arrow::array::StringArray;
205205
use arrow::datatypes::{DataType, Field, Schema};
206206
use arrow::record_batch::RecordBatch;
207-
use datafusion_common::Result;
208207

209208
use std::sync::Arc;
210209

@@ -214,8 +213,9 @@ mod test {
214213
let col = Column::new("id", 9);
215214
let error = col.data_type(&schema).expect_err("error").strip_backtrace();
216215
assert!("Internal error: PhysicalExpr Column references column 'id' at index 9 (zero-based) \
217-
but input schema only has 1 columns: [\"foo\"].\nThis was likely caused by a bug in \
218-
DataFusion's code and we would welcome that you file an bug report in our issue tracker".starts_with(&error))
216+
but input schema only has 1 columns: [\"foo\"].\nThis issue was likely caused by a bug \
217+
in DataFusion's code. Please help us to resolve this by filing a bug report \
218+
in our issue tracker: https://github.com/apache/datafusion/issues".starts_with(&error))
219219
}
220220

221221
#[test]
@@ -224,20 +224,21 @@ mod test {
224224
let col = Column::new("id", 9);
225225
let error = col.nullable(&schema).expect_err("error").strip_backtrace();
226226
assert!("Internal error: PhysicalExpr Column references column 'id' at index 9 (zero-based) \
227-
but input schema only has 1 columns: [\"foo\"].\nThis was likely caused by a bug in \
228-
DataFusion's code and we would welcome that you file an bug report in our issue tracker".starts_with(&error))
227+
but input schema only has 1 columns: [\"foo\"].\nThis issue was likely caused by a bug \
228+
in DataFusion's code. Please help us to resolve this by filing a bug report \
229+
in our issue tracker: https://github.com/apache/datafusion/issues".starts_with(&error));
229230
}
230231

231232
#[test]
232-
fn out_of_bounds_evaluate() -> Result<()> {
233+
fn out_of_bounds_evaluate() {
233234
let schema = Schema::new(vec![Field::new("foo", DataType::Utf8, true)]);
234235
let data: StringArray = vec!["data"].into();
235-
let batch = RecordBatch::try_new(Arc::new(schema), vec![Arc::new(data)])?;
236+
let batch = RecordBatch::try_new(Arc::new(schema), vec![Arc::new(data)]).unwrap();
236237
let col = Column::new("id", 9);
237238
let error = col.evaluate(&batch).expect_err("error").strip_backtrace();
238239
assert!("Internal error: PhysicalExpr Column references column 'id' at index 9 (zero-based) \
239-
but input schema only has 1 columns: [\"foo\"].\nThis was likely caused by a bug in \
240-
DataFusion's code and we would welcome that you file an bug report in our issue tracker".starts_with(&error));
241-
Ok(())
240+
but input schema only has 1 columns: [\"foo\"].\nThis issue was likely caused by a bug \
241+
in DataFusion's code. Please help us to resolve this by filing a bug report \
242+
in our issue tracker: https://github.com/apache/datafusion/issues".starts_with(&error));
242243
}
243244
}

datafusion/sql/src/expr/identifier.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,8 @@ mod test {
459459
fn test_form_identifier() -> Result<()> {
460460
let err = form_identifier(&[]).expect_err("empty identifiers didn't fail");
461461
let expected = "Internal error: Incorrect number of identifiers: 0.\n\
462-
This was likely caused by a bug in DataFusion's code and we would \
463-
welcome that you file an bug report in our issue tracker";
462+
This issue was likely caused by a bug in DataFusion's code. Please help us to resolve this \
463+
by filing a bug report in our issue tracker: https://github.com/apache/datafusion/issues";
464464
assert!(expected.starts_with(&err.strip_backtrace()));
465465

466466
let ids = vec!["a".to_string()];
@@ -497,8 +497,8 @@ mod test {
497497
])
498498
.expect_err("too many identifiers didn't fail");
499499
let expected = "Internal error: Incorrect number of identifiers: 5.\n\
500-
This was likely caused by a bug in DataFusion's code and we would \
501-
welcome that you file an bug report in our issue tracker";
500+
This issue was likely caused by a bug in DataFusion's code. Please help us to resolve this \
501+
by filing a bug report in our issue tracker: https://github.com/apache/datafusion/issues";
502502
assert!(expected.starts_with(&err.strip_backtrace()));
503503

504504
Ok(())

0 commit comments

Comments
 (0)