AlejandroMorgante commented on code in PR #60248:
URL: https://github.com/apache/spark/pull/60248#discussion_r4527983334


##########
python/pyspark/sql/classic/dataframe.py:
##########
@@ -1741,6 +1741,15 @@ def approxQuantile(
                         "arg_type": type(p).__name__,
                     },
                 )
+            if p < 0 or p > 1:
+                raise PySparkValueError(
+                    errorClass="VALUE_NOT_BETWEEN",
+                    messageParameters={
+                        "arg_name": "probabilities",
+                        "min": "0",
+                        "max": "1",
+                    },
+                )
         probabilities = _to_list(self._sc, cast(List["ColumnOrName"], 
probabilities))
 
         if not isinstance(relativeError, (float, int)):

Review Comment:
   Good catch, confirmed relativeError has the same **NaN** hole (and **bool** 
too, same as probabilities). Filed and fixed separately in #60306, since it's a 
different argument with its own bug.



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