-
Notifications
You must be signed in to change notification settings - Fork 29.1k
[SPARK-36654][PYTHON] Drop type ignores from numpy imports #33900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Test build #142941 has finished for PR 33900 at commit
|
|
Kubernetes integration test unable to build dist. exiting with code: 1 |
|
Test build #142978 has finished for PR 33900 at commit
|
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
|
Test build #144142 has finished for PR 33900 at commit
|
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
|
Test build #144193 has finished for PR 33900 at commit
|
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
|
Test build #144322 has finished for PR 33900 at commit
|
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
|
Thanks @HyukjinKwon, @ueshin Merged to master. |
What changes were proposed in this pull request?
This PR removes
type: ignore[import]annotations from numpy imports.Additionally, minimum version of numpy required for the mypy tests is explicitly stated in the GitHub workflow files.
Why are the changes needed?
Since version 1.20 numpy is PEP 561 compatible so these ignores are no longer necessary.
Does this PR introduce any user-facing change?
This change targets primarily our development process and should be relatively transparent to the end users:
If
pysparkis installed as a package in the current environment both current master and this pr yield the same results (test_pr_package.sh.out.txt and test_master_package.sh.out.txt respectively)If
pysparkis added manually toMYPYPATHboth this pr and current master yield large number of errors (test_pr_mypypath.sh.out.txt and test_master_mypypath.sh.out.txt respectively)These errors are primarily, but not exclusively, related to
pyspark.pandashints (notable exception iscloudpickle‒ to avoid this we could bring back stub file, that was removed during initial type hints migration).In this case, users can silence the errors,, by providing appropriate
mypy.inifile.This behavior was tested using simple test files
and
How was this patch tested?
Existing tests and manual verification of the behavior in isolated environments.