You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by zjffdu <gi...@git.apache.org> on 2017/04/11 06:23:05 UTC

[GitHub] zeppelin pull request #2240: ZEPPELIN-2386. Add parameter for check running ...

GitHub user zjffdu opened a pull request:

    https://github.com/apache/zeppelin/pull/2240

    ZEPPELIN-2386. Add parameter for check running current paragraph in ZeppelinContext

    ### What is this PR for?
    I can reproduce it via the test code in ZeppelinIT.testAngularDisplay. First run the 4 paragraphs to initiate the state. Then when I click paragraph 0 the first time, paragraph 2 will run correctly. But if I click paragraph 0 again, interpreter would raise the following exception. The cause is that ZeppelinContext's interpreterContext now point to paragraph 2, because paragraph 2 is the last paragraph that runs in this interpreter. So I propose to add parameter to 
    
    
    ### What type of PR is it?
    [Bug Fix | Improvement | Feature | Documentation | Hot Fix | Refactoring]
    
    ### Todos
    * [ ] - Task
    
    ### What is the Jira issue?
    * Open an issue on Jira https://issues.apache.org/jira/browse/ZEPPELIN/
    * Put link here, and add [ZEPPELIN-*Jira number*] in PR title, eg. [ZEPPELIN-533]
    
    ### How should this be tested?
    Outline the steps to test the PR here.
    
    ### Screenshots (if appropriate)
    
    ### Questions:
    * Does the licenses files need update?
    * Is there breaking changes for older versions?
    * Does this needs documentation?


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zjffdu/zeppelin ZEPPELIN-2386

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zeppelin/pull/2240.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2240
    
----
commit 5cf771103fc38008b11910573eabd218f81ebd88
Author: Jeff Zhang <zj...@apache.org>
Date:   2017-04-11T06:21:53Z

    ZEPPELIN-2386. Add parameter to check running current paragraph in ZeppelinContext

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2240: ZEPPELIN-2386. Add parameter for check running current...

Posted by zjffdu <gi...@git.apache.org>.
Github user zjffdu commented on the issue:

    https://github.com/apache/zeppelin/pull/2240
  
    @Leemoonsoo Thanks for suggestion, the second approach works, but I didn't find a way to take `InterpreterContext` automatically. Another scenario is that user may do need to run the current paragraph. In the following code, I want to rerun the current paragraph if user click the link. 
    
    ```
    println("%angular <div id=\'angularTestButton\' ng-click=\'myVar=myVar+1\'>BindingTest_{{myVar}}_</div>")
    
    z.angularBind("myVar", 0)
    z.angularWatch("myVar", "watcher_1", (before:Object, after:Object, context:org.apache.zeppelin.interpreter.InterpreterContext)=>{
        z.run("20170410-172601_2116783047")
    })
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2240: ZEPPELIN-2386. Add parameter for check running current...

Posted by Leemoonsoo <gi...@git.apache.org>.
Github user Leemoonsoo commented on the issue:

    https://github.com/apache/zeppelin/pull/2240
  
    @zjffdu 
    
    In ZeppelinIT.testAngularDisplay, 4th paragraph creates watcher and watcher call `z.run()` without passing interpreter context. like
    
    ```scala
    z.angularWatch("myVar", (before:Object, after:Object, 
      context:org.apache.zeppelin.interpreter.InterpreterContext)=>{ 
        z.run(2)
      }
    )
    ```
    
    If we pass interpreter context is passed to `z.run()`, the error does not occur. like
    
    ```scala
    z.angularWatch("myVar", (before:Object, after:Object, 
      context:org.apache.zeppelin.interpreter.InterpreterContext)=>{ 
        z.run(context.getNoteId, 2, context)
      }
    )
    ```
    
    @zjffdu Do you think will there a way `z.run()` takes `InterpreterContext` automatically? If that's possible, then user does not need to care about `checkCurrentParagraph`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2240: ZEPPELIN-2386. Add parameter for check running current...

Posted by zjffdu <gi...@git.apache.org>.
Github user zjffdu commented on the issue:

    https://github.com/apache/zeppelin/pull/2240
  
    @Leemoonsoo @jongyoul  Please help review.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2240: ZEPPELIN-2386. Add parameter for check running current...

Posted by Leemoonsoo <gi...@git.apache.org>.
Github user Leemoonsoo commented on the issue:

    https://github.com/apache/zeppelin/pull/2240
  
    Thanks for explain.
    LGTM


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #2240: ZEPPELIN-2386. Add parameter for check running current...

Posted by zjffdu <gi...@git.apache.org>.
Github user zjffdu commented on the issue:

    https://github.com/apache/zeppelin/pull/2240
  
    Thanks @Leemoonsoo for review, will merge to master if no more comments


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin pull request #2240: ZEPPELIN-2386. Add parameter for check running ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/zeppelin/pull/2240


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---