dongjoon-hyun commented on code in PR #60248:
URL: https://github.com/apache/spark/pull/60248#discussion_r4521497434


##########
python/pyspark/sql/tests/connect/test_connect_stat.py:
##########
@@ -263,19 +263,15 @@ def test_stat_approx_quantile(self):
                 "arg_type": "float",
             },
         )
-        with self.assertRaises(PySparkTypeError) as pe:
+        with self.assertRaises(PySparkValueError) as pe:

Review Comment:
   This test change shows that this PR changes the exception class users see: 
an out-of-range `probabilities` value used to raise `PySparkTypeError` (a 
`TypeError`) and now raises `PySparkValueError` (a `ValueError`). Existing user 
code like `except TypeError:` will stop catching it after upgrading.
   
   Could you add an entry to the `Upgrading from PySpark 4.2 to 4.3` section of 
`python/docs/source/migration_guide/pyspark_upgrade.rst`? There is a precedent 
for this kind of change in the same file: `In Spark 3.2, the PySpark methods 
from sql, ml, spark_on_pandas modules raise the TypeError instead of ValueError 
when are applied to a param of inappropriate type.`



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