Skip to content

Commit

Permalink
Make Index Join Tests on Default Precisions Deterministic (#11451)
Browse files Browse the repository at this point in the history
This PR fixes a flaky test introduced by #11272, cudf joins by default does not guarantee return orders and may lead to occasional test regression. This PR adds `sort` argument to make sure result is deterministic.

Note that `index.union` and `index.intersection` may also include random output ordering, but by default these methods sorts the result before returning so `sort` argument does not need to be modified.

Authors:
   - Michael Wang (https://github.com/isVoid)

Approvers:
   - GALI PREM SAGAR (https://github.com/galipremsagar)
   - https://github.com/brandon-b-miller
   - Nghia Truong (https://github.com/ttnghia)
  • Loading branch information
isVoid authored Aug 3, 2022
1 parent dcae9f7 commit b2ae9a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/cudf/cudf/tests/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -2674,7 +2674,7 @@ def test_rangeindex_join_user_option(default_integer_bitwidth):
idx1 = cudf.RangeIndex(0, 10)
idx2 = cudf.RangeIndex(5, 15)

actual = idx1.join(idx2, how="inner")
actual = idx1.join(idx2, how="inner", sort=True)
expected = cudf.Index(
[5, 6, 7, 8, 9], dtype=f"int{default_integer_bitwidth}", name=0
)
Expand Down

0 comments on commit b2ae9a9

Please sign in to comment.