This is an automated email from the ASF dual-hosted git repository.

timsaucer pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-python.git


The following commit(s) were added to refs/heads/main by this push:
     new adec2dcd Improve displayed error by using `DataFusionError`'s 
`Display` trait (#1370)
adec2dcd is described below

commit adec2dcd785daa16a02f8029c1067c1d7594d67c
Author: Antoine Beyeler <[email protected]>
AuthorDate: Wed Feb 4 20:37:29 2026 +0100

    Improve displayed error by using `DataFusionError`'s `Display` trait (#1370)
    
    * Use  instead of  for
    
    * update test
---
 python/tests/test_indexing.py | 2 +-
 python/tests/test_udf.py      | 2 +-
 src/errors.rs                 | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/python/tests/test_indexing.py b/python/tests/test_indexing.py
index 327decd2..e4c60b55 100644
--- a/python/tests/test_indexing.py
+++ b/python/tests/test_indexing.py
@@ -43,7 +43,7 @@ def test_err(df):
     with pytest.raises(Exception) as e_info:
         df["c"]
 
-    for e in ["SchemaError", "FieldNotFound", 'name: "c"']:
+    for e in ["Schema error", "No field named c"]:
         assert e in e_info.value.args[0]
 
     with pytest.raises(Exception) as e_info:
diff --git a/python/tests/test_udf.py b/python/tests/test_udf.py
index c90668ef..c0ba1d83 100644
--- a/python/tests/test_udf.py
+++ b/python/tests/test_udf.py
@@ -207,4 +207,4 @@ def test_udf_with_nullability(ctx: SessionContext) -> None:
 
     with pytest.raises(Exception) as e_info:
         _results = df_result.collect()
-    assert "InvalidArgumentError" in str(e_info)
+    assert "Invalid argument error" in str(e_info)
diff --git a/src/errors.rs b/src/errors.rs
index fc079eb6..d1b51804 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -39,7 +39,7 @@ pub enum PyDataFusionError {
 impl fmt::Display for PyDataFusionError {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         match self {
-            PyDataFusionError::ExecutionError(e) => write!(f, "DataFusion 
error: {e:?}"),
+            PyDataFusionError::ExecutionError(e) => write!(f, "DataFusion 
error: {e}"),
             PyDataFusionError::ArrowError(e) => write!(f, "Arrow error: 
{e:?}"),
             PyDataFusionError::PythonError(e) => write!(f, "Python error 
{e:?}"),
             PyDataFusionError::Common(e) => write!(f, "{e}"),


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

Reply via email to