Uh oh!
There was an error while loading. Please reload this page.
[MINOR][DOCS] Fix minor typos in python example code - #14805
[MINOR][DOCS] Fix minor typos in python example code#14805silentsokolov wants to merge 2 commits into
Conversation
srowen
commented
Aug 25, 2016
OK, can you perhaps quickly search for other instances of the same in Python code? it's worth a skim if you're up for it. |
srowen
commented
Aug 25, 2016
Jenkins test this please |
SparkQA
commented
Aug 25, 2016
Test build #64414 has finished for PR 14805 at commit
|
silentsokolov
commented
Aug 26, 2016
I looked through all the python code examples, fixed typos and formatting |
There was a problem hiding this comment.
Yeah I think it's good to standardize strings on double quotes, unless I'm missing some important difference. There are some other good clear fixes here. The whitespace changes are probably not worth it but I'd leave them in. What about this though, is it really more standard not to precede the continuation with a space?
There was a problem hiding this comment.
@srowen, there is no clear definition of it.
https://docs.python.org/2/reference/lexical_analysis.html#explicit-line-joining
https://www.python.org/dev/peps/pep-0008/#maximum-line-length
I use:
# with spaceif1900<year<2100and1<=month<=12:
return1if1900<year<2100 \
and1<=month<=12:
return1# without spaces='Hello world'.lower().split()
s='Hello world'.lower()\
.split()This makes the code more readable. Or return to the code spaces?
There was a problem hiding this comment.
Using simple or double quote have impact on Python, it's up to the developer's will.
Adding a space before the '' makes sense, even though I prefere the following syntax for RDD filters:
socketDF = (spark
.readStream()
.format("socket")
.option("host", "localhost")
.option("port", 9999)
.load())
srowen
commented
Aug 26, 2016
@stibbons since you're around, do you have any comments on these Python style changes? |
Look good to me. I think it good to have the space arround kwargs assignation removed to distinguish beween and which is a good habit to take (and PEP8) |
For information, autopep8 will do all the space changes automatically on python files, and we can ask sphinx to automatically pep8 (check) autopep8 (fix some pep issues) all python codes |
I returned the spaces (in all python examples) |
srowen
commented
Aug 26, 2016
OK, it's looking good to me. I wouldn't mind a set of eyes more familiar with Python to look at it. In particular just want to make sure we're headed towards more standardization in all cases. |
srowen
commented
Aug 29, 2016
Jenkins retest this please |
SparkQA
commented
Aug 29, 2016
Test build #64564 has finished for PR 14805 at commit
|
srowen
commented
Aug 30, 2016
Merged to master |
What changes were proposed in this pull request?
Fix minor typos python example code in streaming programming guide
How was this patch tested?
N/A