blaginin commented on code in PR #16184: URL: https://github.com/apache/datafusion/pull/16184#discussion_r2107709972
########## datafusion/expr/src/logical_plan/builder.rs: ########## @@ -2592,19 +2587,29 @@ mod tests { let err = nested_table_scan("test_table")? .unnest_column("scalar") .unwrap_err(); - assert!(err - .to_string() - .starts_with("Internal error: trying to unnest on invalid data type UInt32")); + + let DataFusionError::Internal(desc) = err else { + return plan_err!("Plan should have returned an DataFusionError::Internal"); + }; + + let desc = desc + .split(DataFusionError::BACK_TRACE_SEP) + .collect::<Vec<&str>>() + .first() + .unwrap_or(&"") + .to_string(); + + assert_snapshot!(desc, @"trying to unnest on invalid data type UInt32"); Review Comment: Thanks for the screenshot! This may be happening because locally you run tests without the `backtrace` feature. As a result, when you run it without the feature, you get: ``` Internal error: trying to unnest on invalid data type UInt32. This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker ``` However, with backtrace, we get: ``` Internal error: trying to unnest on invalid data type UInt32. -- (backtrace) -- This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker ``` I think a robust solution would be adding a redaction to eliminate the backtrace and adding a dev note somewhere to apply that redaction to all tests that rely on error formatting. That said, your solution is fine too - up to you if you want to leave it as is or change. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org