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

dongjoon 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 1586652b6421 [MINOR][PS][TESTS] Make `test_compare` deterministic
1586652b6421 is described below

commit 1586652b64212c1e9f4bb5346a2d5f83a271883e
Author: Ruifeng Zheng <ruife...@apache.org>
AuthorDate: Tue Apr 9 07:45:05 2024 -0700

    [MINOR][PS][TESTS] Make `test_compare` deterministic
    
    ### What changes were proposed in this pull request?
    Make `test_compare` deterministic
    
    ### Why are the changes needed?
    it fails in some env:
    ```
    AssertionError: DataFrame.index are different
    DataFrame.index values are different (80.0 %)
    [left]:  Int64Index([3, 4, 5, 6, 7], dtype='int64')
    [right]: Int64Index([4, 3, 7, 6, 5], dtype='int64')
    ```
    
    ### Does this PR introduce _any_ user-facing change?
    no, test only
    
    ### How was this patch tested?
    ci
    
    ### Was this patch authored or co-authored using generative AI tooling?
    no
    
    Closes #45959 from zhengruifeng/fix_test_compare_series.
    
    Authored-by: Ruifeng Zheng <ruife...@apache.org>
    Signed-off-by: Dongjoon Hyun <dh...@apple.com>
---
 python/pyspark/pandas/tests/diff_frames_ops/test_compare_series.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/pyspark/pandas/tests/diff_frames_ops/test_compare_series.py 
b/python/pyspark/pandas/tests/diff_frames_ops/test_compare_series.py
index c548f8a2d32c..2befaa6ed950 100644
--- a/python/pyspark/pandas/tests/diff_frames_ops/test_compare_series.py
+++ b/python/pyspark/pandas/tests/diff_frames_ops/test_compare_series.py
@@ -131,7 +131,7 @@ class CompareSeriesMixin:
         )
 
         with ps.option_context("compute.eager_check", False):
-            self.assert_eq(expected, psser1.compare(psser2))
+            self.assert_eq(expected, psser1.compare(psser2).sort_index())
 
 
 class CompareSeriesTests(


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

Reply via email to