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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]