-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-7977] [Build] Disallowing println #7093
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
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.
It seems like a number of cases like this might be bad uses of println? I don't immediately see why this isn't a normal log
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.
Any guidelines on what should be a println or a log?
I'll be glad to go through and check them.
|
Is there any way to exclude the example files from this rule? The examples seems to require the ugly |
|
Checking out options for excluding examples |
- Commented code does not get validated - Some unnecessary comments removed
Conflicts: core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala sql/core/src/main/scala/org/apache/spark/sql/DataFrame.scala sql/hive/src/test/resources/regression-test-SPARK-8489/Main.scala
|
@tdas scalastyle currently does not provide a way to exclude a folder (or files) from this rule. Wrapping the full example in |
|
I think that is a better idea. Much less intrusive. Thank you for finding On Tue, Jun 30, 2015 at 9:43 AM, Jonathan Alter [email protected]
|
Conflicts: core/src/main/scala/org/apache/spark/deploy/Client.scala
|
@srowen - I have addressed the point you made regarding using log rather than println in some cases. Please let me know what you think. Thank you. |
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.
This is a big change. I still think a number of these printlns are debug leftovers and can be removed, or in some cases turned into logging. I don't know of a good way to review these other than to just sift through this a few times. I think anything in a main() method or close support of a CLI utility can stay; examples too are probably OK with println. Obviously there are some methods whose job it is to print to the console directly. Everything else, not sure where you would generally allow println.
So, this is one I think can be removed?
|
Heroic effort here. It certainly is big but is fixing up a lot of little issues of this form. I flagged a few more questions about it but it is looking pretty good. Is anyone else concerned about the cost of future merge conflicts on this one vs the benefit? |
|
Pinging people like @pwendell @JoshRosen @rxin @vanzin for thoughts about the scope of the change vs value -- anybody object? |
|
+1 on the change. Historically I don't think it doesn't make it much harder to backport fixes from small style changes. And most likely we don't backport printlns anyway. The import one is slightly larger -- but even that I'm for merging it in towards the end of a release cycle. |
|
Test build #1005 timed out for PR 7093 at commit |
|
Test build #1010 timed out for PR 7093 at commit |
|
I can't figure out why this keeps timing out as it still doesn't look related to this change. Will try again later. |
|
I'm thinking the issue may actually be a failure and not just a timeout. Looks like it is having a serialization issue around |
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.
@srowen I confirmed the test is having trouble with logInfo here and works fine with println. Should I just revert this?
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.
Oh darn, maybe the logging ends up dragging in some reference to the outer class. Maybe just zap this whole clause, or make the error message a field in this ThreadingSuiteState and use it below.
logInfo was causing the test to fail with `org.apache.spark.SparkException: Task not serializable`
|
Ooops, sorry about that. |
|
Test build #1037 has finished for PR 7093 at commit
|
No description provided.