Skip to content

Fixed pyspark indentation issue: ZEPPELIN-34#61

Closed
whisperstream wants to merge 1 commit intoapache:masterfrom
whisperstream:pyspark-indentation-fix-1
Closed

Fixed pyspark indentation issue: ZEPPELIN-34#61
whisperstream wants to merge 1 commit intoapache:masterfrom
whisperstream:pyspark-indentation-fix-1

Conversation

@whisperstream
Copy link
Copy Markdown
Contributor

Fixes the pyspark indentation issue discussed here: https://issues.apache.org/jira/browse/ZEPPELIN-34

Allows you to have indented and nested code:

%pyspark
def test_fix(text):
    for i in range(1, 10):
        print text + str(i)
test_fix("now fixed - ")

@whisperstream
Copy link
Copy Markdown
Contributor Author

sorry, looks like the indentation changed dramatically when I changed the file, will re-submit as there were only a few line changes

@Leemoonsoo
Copy link
Copy Markdown
Member

Hi @whisperstream.

Could you try

%pyspark
if True:
    print "Yup"
else:
    print "Nope"

I get

(<type 'exceptions.SyntaxError'>, SyntaxError('invalid syntax', ('<string>', 1, 4, 'else:')), <traceback object at 0x10c3becf8>)

with this branch

@whisperstream
Copy link
Copy Markdown
Contributor Author

You're right, it didn't work for that case. I have submitted a new pull
request, with a simplified version that seems to work for all cases:

#63

-Axel

On Wed, May 6, 2015 at 1:01 AM, Lee moon soo [email protected]
wrote:

Hi @whisperstream https://github.com/whisperstream.

Could you try

%pysparkif True:
print "Yup"else:
print "Nope"

I get

(<type 'exceptions.SyntaxError'>, SyntaxError('invalid syntax', ('', 1, 4, 'else:')), <traceback object at 0x10c3becf8>)

with this branch


Reply to this email directly or view it on GitHub
#61 (comment)
.

@jongyoul
Copy link
Copy Markdown
Member

@whisperstream Please close this issue. I've seen #63 resolved this issue.

@jongyoul
Copy link
Copy Markdown
Member

heartbeat

@asfgit asfgit closed this in dcc1655 Sep 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants