Commit 52d52a1
[SPARK-40376][PYTHON] Avoid Numpy deprecation warning
### What changes were proposed in this pull request?
Use `bool` instead of `np.bool` as `np.bool` will be deprecated (see: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations)
Using `np.bool` generates this warning:
```
UserWarning: toPandas attempted Arrow optimization because 'spark.sql.execution.arrow.pyspark.enabled' is set to true, but has reached the error below and can not continue. Note that 'spark.sql.execution.arrow.pyspark.fallback.enabled' does not have an effect on failures in the middle of computation.
3070E `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
3071E Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
```
### Why are the changes needed?
Deprecation soon: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations.
### Does this PR introduce _any_ user-facing change?
The warning will be suppressed
### How was this patch tested?
Existing tests should suffice.
Closes #37817 from ELHoussineT/patch-1.
Authored-by: ELHoussineT <[email protected]>
Signed-off-by: Sean Owen <[email protected]>1 parent 11eb66e commit 52d52a1
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
| 298 | + | |
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| |||
0 commit comments