spark-instrumented-optimizer/python/pyspark/ml/param
Yikun Jiang 44b7931936 [SPARK-35176][PYTHON] Standardize input validation error type
### 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

Closes #32368 from Yikun/SPARK-35176.

Authored-by: Yikun Jiang <yikunkero@gmail.com>
Signed-off-by: HyukjinKwon <gurwls223@apache.org>
2021-05-03 15:34:24 +09:00
..
__init__.py [SPARK-35176][PYTHON] Standardize input validation error type 2021-05-03 15:34:24 +09:00
__init__.pyi [SPARK-32714][PYTHON] Initial pyspark-stubs port 2020-09-24 14:15:36 +09:00
_shared_params_code_gen.py [SPARK-32907][ML][PYTHON] Adaptively blockify instances - AFT,LiR,LoR 2020-11-18 23:02:31 +08:00
_shared_params_code_gen.pyi [SPARK-32714][PYTHON] Initial pyspark-stubs port 2020-09-24 14:15:36 +09:00
shared.py [SPARK-32907][ML][PYTHON] Adaptively blockify instances - AFT,LiR,LoR 2020-11-18 23:02:31 +08:00
shared.pyi [SPARK-32907][ML][PYTHON] adaptively blockify instances - LinearSVC 2020-11-12 19:14:07 +08:00