-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-33457][PYTHON] Adjust mypy configuration #30382
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
|
FYI @Fokko @HyukjinKwon Still work in progress, any suggestions about desired flags (I considered |
|
My only concern is the maintenance cost for being strict. If it doesn't add non-trivial overhead, I am good to be more strict on the type hints. |
For the first two options - we are already covered, as these were used in The third one required some fixes, but these are mostly things that should be there. In all other cases, we can either ignore the whole module (as with tests and such) or specific lines (for example I considered ignoring So overall, I don't think there's much complexity added and using these, gives us more confidence that annotations are in a good shape. |
|
Test build #131122 has finished for PR 30382 at commit
|
|
Kubernetes integration test starting |
|
Test build #131124 has finished for PR 30382 at commit
|
|
Kubernetes integration test status failure |
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
|
Test build #131515 has finished for PR 30382 at commit
|
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
|
@zero323, let me know when you think this is ready. Looks fine to me. |
Fokko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
|
Test build #131547 has finished for PR 30382 at commit
|
|
Kubernetes integration test starting |
Thanks @HyukjinKwon. I went over all violations of
Thanks for reviewing @Fokko! |
|
Kubernetes integration test status failure |
|
Test build #131599 has finished for PR 30382 at commit
|
|
retest this please |
|
Test build #131614 has finished for PR 30382 at commit
|
|
Merged to master. |
|
Thanks @Fokko and @HyukjinKwon! |
What changes were proposed in this pull request?
This pull request:
strict_optionalno_implicit_optionaldisallow_untyped_defsThese flags are enabled only for public API and disabled for tests and internal modules.
Additionally, these PR fixes missing annotations.
Why are the changes needed?
Primary reason to propose this changes is to use standard configuration as used by typeshed project. This will allow us to be more strict, especially when interacting with JVM code. See for example #29122 (review)
Additionally, it will allow us to detect cases where annotations have unintentionally omitted.
Does this PR introduce any user-facing change?
Annotations only.
How was this patch tested?
dev/lint-python.