-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[MINOR][BUILD] ensure call to translate_component has correct number of arguments #23567
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
|
Heh, I'm not even sure this is called. This doesn't do anything with the warnings, so, you could also just remove the unused warnings arg. |
|
@ipwright BTW I love Semmle / LGTM and have had a look through the warnings... I can open a PR to fix a lot of the simple ones. It uncovered at least one non-trivial bug: Pyspark vector classes don't actually implement unary negation correctly. It throws an error. Fixing that ... |
|
Test build #4520 has finished for PR 23567 at commit
|
|
Merged to master |
|
@srowen Thanks for merging, and very glad to hear you like LGTM. I'm happy to submit PRs that fix the simple alerts, if that will save you time (please advise). I helped develop LGTM's code quality algorithms, and so I'm interested in knowing how much fixing and clean-up effort is required to move a project up a grade. E.g., Spark is doing good: I recommend enabling LGTM automated code review on Apache Spark, since it detects problems prior to merging. Best wishes, |
|
Thanks @ipwright , I opened #23571 to fix many of the rest of the small issues, and #23570 to fix a bug. I'm a fan of static analysis just because it occasionally catches real bugs. The only minor issue I find is that the 'unused import' detection doesn't account for doctest usages. The Java code was already pretty OK as IntelliJ inspection had turned up most of the problems, but I don't think we'd made a comprehensive effort on Python. Oege mentioned that Scala analysis might come eventually, which would obviously be really good too, but is a lot harder. |
|
Thanks @srowen, and thanks for fixing those issues. If you have the time, could you point me to an example where Thanks! |
|
@ipwright as an example, in https://lgtm.com/projects/g/apache/spark/snapshot/eabef9f5294181257dc2d5bc39e77652101f48ac/files/python/pyspark/mllib/clustering.py?sort=name&dir=ASC&mode=heatmap#xfc95d54cf2a4e9cd:1 , |
|
@srowen Thanks for the example, which is super helpful. Our Python team has a fix in mind, and we're on the case! P.S. I forgot to mention that you can activate LGTM automated code review from this page: |
|
I think we can't enable it as we don't have admin access but can check on the code status periodically |
…of arguments ## What changes were proposed in this pull request? The call to `translate_component` only supplied 2 out of the 3 required arguments. I added a default empty list for the missing argument to avoid a run-time error. I work for Semmle, and noticed the bug with our LGTM code analyzer: https://lgtm.com/projects/g/apache/spark/snapshot/0655f1624ff7b73e5c8937ab9e83453a5a3a4466/files/dev/create-release/releaseutils.py?sort=name&dir=ASC&mode=heatmap#x1434915b6576fb40:1 ## How was this patch tested? I checked that `./dev/run-tests` pass OK. Closes apache#23567 from ipwright/wrong-number-of-arguments-fix. Authored-by: wright <[email protected]> Signed-off-by: Sean Owen <[email protected]>
…of arguments ## What changes were proposed in this pull request? The call to `translate_component` only supplied 2 out of the 3 required arguments. I added a default empty list for the missing argument to avoid a run-time error. I work for Semmle, and noticed the bug with our LGTM code analyzer: https://lgtm.com/projects/g/apache/spark/snapshot/0655f1624ff7b73e5c8937ab9e83453a5a3a4466/files/dev/create-release/releaseutils.py?sort=name&dir=ASC&mode=heatmap#x1434915b6576fb40:1 ## How was this patch tested? I checked that `./dev/run-tests` pass OK. Closes apache#23567 from ipwright/wrong-number-of-arguments-fix. Authored-by: wright <[email protected]> Signed-off-by: Sean Owen <[email protected]>
What changes were proposed in this pull request?
The call to
translate_componentonly supplied 2 out of the 3 required arguments. I added a default empty list for the missing argument to avoid a run-time error.I work for Semmle, and noticed the bug with our LGTM code analyzer:
https://lgtm.com/projects/g/apache/spark/snapshot/0655f1624ff7b73e5c8937ab9e83453a5a3a4466/files/dev/create-release/releaseutils.py?sort=name&dir=ASC&mode=heatmap#x1434915b6576fb40:1
How was this patch tested?
I checked that
./dev/run-testspass OK.