AlejandroMorgante commented on code in PR #60248:
URL: https://github.com/apache/spark/pull/60248#discussion_r4528026470
##########
python/pyspark/sql/tests/test_functions.py:
##########
@@ -1634,6 +1634,28 @@ def test_approxQuantile(self):
self.assertRaises(TypeError, lambda: df.stat.approxQuantile(("a",
123), [0.1, 0.9], 0.1))
self.assertRaises(TypeError, lambda: df.stat.approxQuantile(["a",
123], [0.1, 0.9], 0.1))
+ with self.assertRaises(PySparkTypeError) as pe:
+ df.stat.approxQuantile("a", [0.1, "0.9"], 0.1)
+
+ self.check_error(
+ exception=pe.exception,
+ errorClass="NOT_EXPECTED_TYPE",
+ messageParameters={
+ "arg_name": "probabilities",
+ "expected_type": "list[float, int]",
+ "arg_type": "str",
+ },
+ )
+
+ with self.assertRaises(PySparkValueError) as pe:
Review Comment:
Done -- added all four: a lower-bound case, NaN, both orderings of a mixed
type/range-invalid list, and a tuple input.
Thanks!
--
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]