itholic commented on code in PR #43444:
URL: https://github.com/apache/spark/pull/43444#discussion_r1373988727
##########
python/pyspark/testing/utils.py:
##########
@@ -592,20 +617,22 @@ def assert_rows_equal(rows1: List[Row], rows2: List[Row]):
rows_str2 += str(r2) + "\n"
if not compare_rows(r1, r2):
diff_rows_cnt += 1
- diff_rows = True
+ has_diff_rows = True
+ if includeDiffRows:
+ diff_rows.append((r1, r2))
generated_diff = _context_diff(
actual=rows_str1.splitlines(), expected=rows_str2.splitlines(),
n=len(zipped)
)
- if diff_rows:
+ if has_diff_rows:
error_msg = "Results do not match: "
percent_diff = (diff_rows_cnt / len(zipped)) * 100
error_msg += "( %.5f %% )" % percent_diff
error_msg += "\n" + "\n".join(generated_diff)
+ data = diff_rows if includeDiffRows else None
raise PySparkAssertionError(
- error_class="DIFFERENT_ROWS",
- message_parameters={"error_msg": error_msg},
+ error_class="DIFFERENT_ROWS", message_parameters={"error_msg":
error_msg}, data=data
Review Comment:
Sure! Will add it
--
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]