Uploaded image for project: 'Zeppelin'
  1. Zeppelin
  2. ZEPPELIN-34

PySpark Indentation Issues

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.5.0
    • 0.5.0
    • None
    • None

    Description

      When trying to run PySpark code with indented blocks, I get errors:

      %pyspark
      count = 0
      for word in data.collect():
          for c in word:
              count += 1
      
      (<type 'exceptions.IndentationError'>, IndentationError('expected an indented block', ('<string>', 2, 18, ' for c in word:')), <traceback object at 0xd12f80>)
      

      and

      %pyspark
      if True:
          print "Yup"
      else:
          print "Nope"
      
      (<type 'exceptions.SyntaxError'>, SyntaxError('invalid syntax', ('<string>', 1, 4, 'else:')), <traceback object at 0xd12e60>)
      

      I'm using Spark 1.3 and Python 2.7.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rnowling R J Nowling
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: