Skip to content

Commit

Permalink
make comparison stable after merge operation
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoly Myachev <[email protected]>
  • Loading branch information
anmyachev committed May 13, 2024
1 parent 981c74e commit b940a3b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions modin/tests/pandas/dataframe/test_join_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,13 @@ def test_merge(test_data, test_data2):
pandas_result = pandas_df.merge(
pandas_df2, how=hows[i], on=ons[j], sort=sorts[j]
)
# sorting in `merge` is implemented through range partitioning technique
# therefore the order of the rows after it does not match the pandas,
# so additional sorting is needed in order to get the same result as for pandas
sort_if_range_partitioning(
modin_result, pandas_result, force=StorageFormat.get() == "Hdk"
modin_result,
pandas_result,
force=StorageFormat.get() == "Hdk" or sorts[j],
)

modin_result = modin_df.merge(
Expand All @@ -316,7 +321,9 @@ def test_merge(test_data, test_data2):
sort=sorts[j],
)
sort_if_range_partitioning(
modin_result, pandas_result, force=StorageFormat.get() == "Hdk"
modin_result,
pandas_result,
force=StorageFormat.get() == "Hdk" or sorts[j],
)

# Test for issue #1771
Expand Down

0 comments on commit b940a3b

Please sign in to comment.