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

python interpreter can not handle functions in certain format

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.6.0
    • 0.7.1, 0.8.0
    • python-interpreter
    • None

    Description

      Python interpreter can not handle a syntax where function is called right after function definition is finished. (formatA). However, if a new line is added after function definition, that syntax works fine with python interpreter.

      We should not need to add a line after function is defined. In python, we do not require to add a line after function is defined.
      Thus, zeppelin interpreter is not handling this situation correctly.
      Zeppelin user should be able to run above commandlines without additional space.

      formatA
      %python
      def greet(name):
          print 'Hello', name
      greet('Jack')
      greet('Jill')
      greet('Bob')
      output
      File "<stdin>", line 3
      
          greet('Jack')
      
              ^
      
      SyntaxError: invalid syntax
      
       Traceback (most recent call last):
      
        File "<stdin>", line 1, in <module>
      
      NameError: name 'greet' is not defined
      
       Traceback (most recent call last):
      
        File "<stdin>", line 1, in <module>
      
      NameError: name 'greet' is not defined
      formatB
      %python
      def greet(name):
          print 'Hello', name
      
      greet('Jack')
      greet('Jill')
      greet('Bob')

      Attachments

        1. note.json
          9 kB
          Alex Goodman

        Issue Links

          Activity

            People

              astroshim Shim HyungSung
              yeshavora Yesha Vora
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: