HyukjinKwon commented on code in PR #42196:
URL: https://github.com/apache/spark/pull/42196#discussion_r1277112278
##########
python/pyspark/testing/utils.py:
##########
@@ -189,6 +190,39 @@ def search_jar(project_relative_path, sbt_jar_name_prefix,
mvn_jar_name_prefix):
return jars[0]
+def _context_diff(actual: List[str], expected: List[str], n: int = 3):
+ """
+ Modified from difflib context_diff API,
+ see original code here:
https://github.com/python/cpython/blob/main/Lib/difflib.py#L1180
+ """
+ def red(s: str) -> str:
+ RedColor = "\033[31m"
+ NoColor = "\033[0m"
+ return RedColor + str(s) + NoColor
Review Comment:
```suggestion
red_color = "\033[31m"
no_color = "\033[0m"
return red_color + str(s) + no_color
```
--
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]