dqkqd commented on code in PR #18623:
URL: https://github.com/apache/datafusion/pull/18623#discussion_r2514921530


##########
datafusion/core/tests/dataframe/mod.rs:
##########
@@ -305,6 +305,17 @@ async fn select_columns() -> Result<()> {
     Ok(())
 }
 
+#[tokio::test]
+async fn select_columns_with_nonexistent_columns() -> Result<()> {
+    let t = test_table().await?;
+    let t2 = t.select_columns(&["canada", "c2", "rocks"]);
+    let Err(DataFusionError::SchemaError(_, _)) = t2 else {
+        return internal_err!("select_columns with nonexistent columns should 
error");
+    };

Review Comment:
   We could verify the actual error message here (or using `assert_snapshot!`):
   
   ```suggestion
       assert_contains!(
           t2.unwrap_err().strip_backtrace(),
           "Schema error: No field named canada"
       );
   ```
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to