Yikun opened a new pull request #32368:
URL: https://github.com/apache/spark/pull/32368


   ### What changes were proposed in this pull request?
   This PR corrects some exception type when the function input params are 
failed to validate due to TypeError.
   In order to convenient to review, there are 3 commits in this PR:
   - Standardize input validation error type on sql
   - Standardize input validation error type on ml
   - Standardize input validation error type on pandas
   
   ### Why are the changes needed?
   As suggestion from Python exception doc [1]: "Raised when an operation or 
function is applied to an object of inappropriate type.", but there are many 
Value error are raised in some pyspark code, this patch fix them.
   
   [1] https://docs.python.org/3/library/exceptions.html#TypeError
   
   Note that: this patch only addresses the exsiting some wrong raise type for 
input validation, the input validation decorator/framework which mentioned in 
[SPARK-35176](https://issues.apache.org/jira/browse/SPARK-35176), would be 
submited in a speparated patch.
   
   ### Does this PR introduce _any_ user-facing change?
   Yes, code can raise the right TypeError instead of ValueError.
   
   ### How was this patch tested?
   Existing test case and UT


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

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