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

gurwls223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 4075ce677120 [SPARK-48374][PYTHON][TESTS][FOLLOW-UP] Explicitly enable 
ANSI mode for non-ANSI build
4075ce677120 is described below

commit 4075ce6771206ac8957029566c8d4196bcb8a87b
Author: Hyukjin Kwon <gurwls...@apache.org>
AuthorDate: Wed Jun 5 12:12:17 2024 +0900

    [SPARK-48374][PYTHON][TESTS][FOLLOW-UP] Explicitly enable ANSI mode for 
non-ANSI build
    
    ### What changes were proposed in this pull request?
    
    This PR proposes to explicitly set ANSI mode in `test_toArrow_error` test.
    
    ### Why are the changes needed?
    
    To make non-ANSI build passing 
https://github.com/apache/spark/actions/runs/9342888897/job/25711689943:
    
    ```
    
    ======================================================================
    FAIL [0.180s]: test_toArrow_error 
(pyspark.sql.tests.connect.test_parity_arrow.ArrowParityTests.test_toArrow_error)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/__w/spark/spark/python/pyspark/sql/tests/test_arrow.py", line 
1207, in test_toArrow_error
        with self.assertRaises(ArithmeticException):
    AssertionError: ArithmeticException not raised
    
    ----------------------------------------------------------------------
    Ran 88 tests in 17.797s
    ```
    
    ### Does this PR introduce _any_ user-facing change?
    
    No, test-only.
    
    ### How was this patch tested?
    
    Manually.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #46872 from HyukjinKwon/SPARK-48374-followup.
    
    Authored-by: Hyukjin Kwon <gurwls...@apache.org>
    Signed-off-by: Hyukjin Kwon <gurwls...@apache.org>
---
 python/pyspark/sql/tests/test_arrow.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/python/pyspark/sql/tests/test_arrow.py 
b/python/pyspark/sql/tests/test_arrow.py
index 74d56491a29e..4e2e2c51b4db 100644
--- a/python/pyspark/sql/tests/test_arrow.py
+++ b/python/pyspark/sql/tests/test_arrow.py
@@ -1204,8 +1204,13 @@ class ArrowTestsMixin:
                 self.spark.sql("select 1/0").toPandas()
 
     def test_toArrow_error(self):
-        with self.assertRaises(ArithmeticException):
-            self.spark.sql("select 1/0").toArrow()
+        with self.sql_conf(
+            {
+                "spark.sql.ansi.enabled": True,
+            }
+        ):
+            with self.assertRaises(ArithmeticException):
+                self.spark.sql("select 1/0").toArrow()
 
     def test_toPandas_duplicate_field_names(self):
         for arrow_enabled in [True, False]:


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to