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 587c863f261 [SPARK-46147][PS][TESTS] Fix the doctest in 
pyspark.pandas.series.Seires.to_dict (Python 3.12)
587c863f261 is described below

commit 587c863f261fef351eebb7f1fca2e38413933cbd
Author: Hyukjin Kwon <gurwls...@apache.org>
AuthorDate: Tue Nov 28 18:08:12 2023 -0800

    [SPARK-46147][PS][TESTS] Fix the doctest in 
pyspark.pandas.series.Seires.to_dict (Python 3.12)
    
    ### What changes were proposed in this pull request?
    
    This PR proposes to fix doctest, `pyspark.pandas.series.Seires.to_dict`, 
compatible with Python 3.12.
    
    ```
    File "/__w/spark/spark/python/pyspark/pandas/series.py", line 1633, in 
pyspark.pandas.series.Series.to_dict
    Failed example:
        s.to_dict(OrderedDict)
    Expected:
        OrderedDict([(0, 1), (1, 2), (2, 3), (3, 4)])
    Got:
        OrderedDict({0: 1, 1: 2, 2: 3, 3: 4})
    ```
    
    ### Why are the changes needed?
    
    For the proper test for Python 3.12. It is failing, see 
https://github.com/apache/spark/actions/runs/7020654429/job/19100966337
    
    ### Does this PR introduce _any_ user-facing change?
    
    No. A bit of user-facing doc change but very trival.
    
    ### How was this patch tested?
    
    Fixed unittests. Manually tested via:
    
    ```bash
    python/run-tests --python-executable=python3  --testnames 
'pyspark.pandas.series'
    ...
    Tests passed in 383 seconds
    ```
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #44063 from HyukjinKwon/SPARK-46147.
    
    Authored-by: Hyukjin Kwon <gurwls...@apache.org>
    Signed-off-by: Dongjoon Hyun <dh...@apple.com>
---
 python/pyspark/pandas/series.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/pyspark/pandas/series.py b/python/pyspark/pandas/series.py
index fedc2417a29..6d7a7c1f2e5 100644
--- a/python/pyspark/pandas/series.py
+++ b/python/pyspark/pandas/series.py
@@ -1631,7 +1631,7 @@ class Series(Frame, IndexOpsMixin, Generic[T]):
 
         >>> from collections import OrderedDict, defaultdict
         >>> s.to_dict(OrderedDict)
-        OrderedDict([(0, 1), (1, 2), (2, 3), (3, 4)])
+        OrderedDict(...)
 
         >>> dd = defaultdict(list)
         >>> s.to_dict(dd)  # doctest: +ELLIPSIS


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

Reply via email to