CODERNSINGH commented on code in PR #60233:
URL: https://github.com/apache/spark/pull/60233#discussion_r4547907502


##########
python/pyspark/eval_handlers/_udtf.py:
##########
@@ -71,6 +72,25 @@
     from pyspark.worker_util import EvalConf, RunnerConf
 
 
+def _partition_values_equal(left: Any, right: Any) -> bool:
+    """
+    Compare two partition key values the way Spark groups them, treating NaN 
as equal to NaN
+    (also when nested inside rows, structs, arrays or maps). Python's ``!=`` 
is not enough,
+    since ``float("nan") != float("nan")`` is True.
+    """
+    if isinstance(left, float) and isinstance(right, float):

Review Comment:
   Done. The helper now returns early when `left == right`, so keys without NaN 
skip the recursive path.
   



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