You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zhengruifeng (via GitHub)" <gi...@apache.org> on 2024/04/09 08:46:49 UTC

[PR] [SPARK-47779][PS][TEST] Add a helper function to sort PS Frame/Series [spark]

zhengruifeng opened a new pull request, #45952:
URL: https://github.com/apache/spark/pull/45952

   
   ### What changes were proposed in this pull request?
   Add a helper function to sort PS Frame/Series
   Use it in `pyspark.pandas.tests.diff_frames_ops.test_arithmetic_*` and their parity tests
   
   
   
   ### Why are the changes needed?
   normally, `sort_index` or `sort_value` is enough to make test result deterministic. However, there are some edge case like `MultiIndex` that the indices could be duplicated and the sorted result is non-deterministic. for example, test `pyspark.pandas.tests.connect.diff_frames_ops.test_parity_arithmetic_chain.ArithmeticChainParityTests.test_arithmetic_chain` fail in some testing envs even with `sort_index`:
   ```
   Left:
   cow     length    250.0
           power       NaN
           speed    -218.8
           speed       1.2
           weight      NaN
   ...
   float64
   Right:
   cow     length    250.0
           power       NaN
           speed       1.2
           speed    -218.8
           weight      NaN
   ...
   float64
   ```
   
   This PR introduce a new helper function to sort indices and values together.
   
   
   ### 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
   


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-47779][PS][TESTS] Add a helper function to sort PS Frame/Series [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #45952:
URL: https://github.com/apache/spark/pull/45952#issuecomment-2044510077

   thanks, merged to master


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-47779][PS][TESTS] Add a helper function to sort PS Frame/Series [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng closed pull request #45952: [SPARK-47779][PS][TESTS] Add a helper function to sort PS Frame/Series
URL: https://github.com/apache/spark/pull/45952


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org