Skip to content

Conversation

@whisperstream
Copy link
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
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
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
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
Member

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

@jongyoul
Copy link
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