-
Notifications
You must be signed in to change notification settings - Fork 29k
Added description to python spark Pi example #19632
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
examples/src/main/python/pi.py
Outdated
| .getOrCreate() | ||
|
|
||
|
|
||
| # If no arguments are passed(i.e. `len(sys.argv) < = 1` ) |
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 isn't visible to end users, so don't know if this matters. It's already documented in the usage. I am not sure this meaningfully helps.
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.
So I think we should expect folks to read the examples in addition to running them. That being said I don't think we need this comment specifically.
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 actually the first example on the spark doc and I wanted to know how the pi calculation was done. There was no mention of what algorithm is used for it, so took me a while to figure out the Monte-Carlo estimator was used and the logic is randomly generating over 100000 points to finally estimate the Pi value.
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.
|
Thanks for helping out with the Spark project, it's great to see folks looking to improve the examples :) I'm not sure the in-line comment adds much, but the docstring one looks like a good minor improvement :) |
|
Test build #3975 has finished for PR 19632 at commit
|
PEP8
Description added for SparkPi example
srowen
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.
Sorry, this still has several problems and doesn't add much. Close it please
| """ | ||
| Usage: pi [partitions] | ||
| Monte Carlo method is used to estimate Pi in the below example. |
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.
below example -> example below
| .appName("PythonPi")\ | ||
| .getOrCreate() | ||
|
|
||
| # If no arguments are passed(i.e. `len(sys.argv) < = 1` ) |
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.
Missing space after passed, problem in "< ="
This comment just restates the code below.
Closes apache#11494 Closes apache#14158 Closes apache#16803 Closes apache#16864 Closes apache#17455 Closes apache#17936 Closes apache#19377 Added: Closes apache#19380 Closes apache#18642 Closes apache#18377 Closes apache#19632 Added: Closes apache#14471 Closes apache#17402 Closes apache#17953 Closes apache#18607 Also cc srowen vanzin HyukjinKwon gatorsmile cloud-fan to see if you have other PRs to close. Author: Xingbo Jiang <[email protected]> Closes apache#19669 from jiangxb1987/stale-prs.
What changes were proposed in this pull request?
Description added to better understand example.
How was this patch tested?
Not required as only comments are required.
Please review http://spark.apache.org/contributing.html before opening a pull request.