You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by bz...@apache.org on 2016/11/13 22:17:22 UTC

zeppelin git commit: [ZEPPELIN-1655] Dynamic forms in Python interpreter do not work

Repository: zeppelin
Updated Branches:
  refs/heads/master c1254f7b0 -> aded8681b


[ZEPPELIN-1655] Dynamic forms in Python interpreter do not work

### What is this PR for?
After #1534 , Dynamic Forms were no longer working in the python interpreter. This is because the `Py4jZeppelinContext` constructor did not initialize the `_displayhook` which is always called on post-execute.

### What type of PR is it?
Bug Fix

### What is the Jira issue?
[ZEPPELIN-1655](https://issues.apache.org/jira/browse/ZEPPELIN-1655)

### How should this be tested?
Run the following `%python` paragraph, being sure that Py4j is installed:
```python
%python
a, b, c = (1, 2, 3)
z.select("Choose a letter", ([a,"a"], [b,"b"], [c,"c"] ))
```

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: Alex Goodman <ag...@users.noreply.github.com>

Closes #1626 from agoodm/ZEPPELIN-1655 and squashes the following commits:

2e4ee2d [Alex Goodman] Make sure _displayhook is initialized in Py4jZeppelinContext


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/aded8681
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/aded8681
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/aded8681

Branch: refs/heads/master
Commit: aded8681bb06e2ca897253820640b153afa3c468
Parents: c1254f7
Author: Alex Goodman <ag...@users.noreply.github.com>
Authored: Sun Nov 13 10:10:50 2016 -0800
Committer: Alexander Bezzubov <bz...@apache.org>
Committed: Sun Nov 13 23:17:11 2016 +0100

----------------------------------------------------------------------
 python/src/main/resources/bootstrap.py       | 2 +-
 python/src/main/resources/bootstrap_input.py | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/aded8681/python/src/main/resources/bootstrap.py
----------------------------------------------------------------------
diff --git a/python/src/main/resources/bootstrap.py b/python/src/main/resources/bootstrap.py
index dbe5e35..6cbf6e4 100644
--- a/python/src/main/resources/bootstrap.py
+++ b/python/src/main/resources/bootstrap.py
@@ -119,6 +119,7 @@ class PyZeppelinContext(object):
     def __init__(self):
         self.max_result = 1000
         self._displayhook = lambda *args: None
+        self._setup_matplotlib()
     
     def input(self, name, defaultValue=""):
         print(self.errorMsg)
@@ -231,4 +232,3 @@ class PyZeppelinContext(object):
 
 
 z = PyZeppelinContext()
-z._setup_matplotlib()

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/aded8681/python/src/main/resources/bootstrap_input.py
----------------------------------------------------------------------
diff --git a/python/src/main/resources/bootstrap_input.py b/python/src/main/resources/bootstrap_input.py
index e006816..6a0c544 100644
--- a/python/src/main/resources/bootstrap_input.py
+++ b/python/src/main/resources/bootstrap_input.py
@@ -26,6 +26,7 @@ class Py4jZeppelinContext(PyZeppelinContext):
     """A context impl that uses Py4j to communicate to JVM
     """
     def __init__(self, z):
+        PyZeppelinContext.__init__(self)
         self.z = z
         self.paramOption = gateway.jvm.org.apache.zeppelin.display.Input.ParamOption
         self.javaList = gateway.jvm.java.util.ArrayList