zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject zeppelin git commit: [ZEPPELIN-1655] Dynamic forms in Python interpreter do not work
Date Sun, 13 Nov 2016 22:17:22 GMT
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 <agoodm@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 <agoodm@users.noreply.github.com>
Authored: Sun Nov 13 10:10:50 2016 -0800
Committer: Alexander Bezzubov <bzz@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


Mime
View raw message