allisonwang-db commented on code in PR #41924:
URL: https://github.com/apache/spark/pull/41924#discussion_r1260237411


##########
python/pyspark/testing/utils.py:
##########
@@ -382,18 +388,23 @@ def assert_rows_equal(rows1: List[Row], rows2: List[Row]):
         try:
             # rename duplicate columns for sorting
             renamed_df = df.toDF(*[f"_{i}" for i in range(len(df.columns))])
-            renamed_expected = expected.toDF(*[f"_{i}" for i in 
range(len(expected.columns))])
-
             df = renamed_df.sort(renamed_df.columns).toDF(*df.columns)
-            expected = 
renamed_expected.sort(renamed_expected.columns).toDF(*expected.columns)
+            if isinstance(expected, List):
+                expected.sort()

Review Comment:
   There is a flag  `check_row_orders`. If this flag is False, we will sort 
both the input data frame and the expected list of Rows. @ueshin do you think 
it makes more sense to set the default value to be `True` instead?



-- 
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]

Reply via email to