You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by mo...@apache.org on 2016/05/03 21:07:52 UTC
incubator-zeppelin git commit: [ZEPPELIN-779] Dynamic form doesn't
work with python3
Repository: incubator-zeppelin
Updated Branches:
refs/heads/master 979d8a37f -> 8ee3667c6
[ZEPPELIN-779] Dynamic form doesn't work with python3
### What is this PR for?
When pyspark interpreter configured to use python3, dynamic form doesn't work.
https://issues.apache.org/jira/browse/ZEPPELIN-779
### What type of PR is it?
Bug Fix
### Todos
* [x] - Convert map to list
### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-779
### How should this be tested?
configure pyspark interpreter to use python3 and run
```
%pyspark
print("Hello "+z.select("day", [("1","mon"),
("2","tue"),
("3","wed"),
("4","thurs"),
("5","fri"),
("6","sat"),
("7","sun")]))
```
### Screenshots (if appropriate)
### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no
Author: Lee moon soo <mo...@apache.org>
Closes #864 from Leemoonsoo/ZEPPELIN-779 and squashes the following commits:
ba2db3b [Lee moon soo] Convert map to list
Project: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/commit/8ee3667c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/tree/8ee3667c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/diff/8ee3667c
Branch: refs/heads/master
Commit: 8ee3667c65a124d7f87f028e02a78c903fcb8757
Parents: 979d8a3
Author: Lee moon soo <mo...@apache.org>
Authored: Thu Apr 28 10:07:03 2016 -0700
Committer: Lee moon soo <mo...@apache.org>
Committed: Tue May 3 12:08:13 2016 -0700
----------------------------------------------------------------------
spark/src/main/resources/python/zeppelin_pyspark.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/8ee3667c/spark/src/main/resources/python/zeppelin_pyspark.py
----------------------------------------------------------------------
diff --git a/spark/src/main/resources/python/zeppelin_pyspark.py b/spark/src/main/resources/python/zeppelin_pyspark.py
index 788d743..83ab7b3 100644
--- a/spark/src/main/resources/python/zeppelin_pyspark.py
+++ b/spark/src/main/resources/python/zeppelin_pyspark.py
@@ -83,14 +83,14 @@ class PyZeppelinContext(dict):
def select(self, name, options, defaultValue = ""):
# auto_convert to ArrayList doesn't match the method signature on JVM side
- tuples = map(lambda items: self.__tupleToScalaTuple2(items), options)
+ tuples = list(map(lambda items: self.__tupleToScalaTuple2(items), options))
iterables = gateway.jvm.scala.collection.JavaConversions.collectionAsScalaIterable(tuples)
return self.z.select(name, defaultValue, iterables)
def checkbox(self, name, options, defaultChecked = None):
if defaultChecked is None:
- defaultChecked = map(lambda items: items[0], options)
- optionTuples = map(lambda items: self.__tupleToScalaTuple2(items), options)
+ defaultChecked = list(map(lambda items: items[0], options))
+ optionTuples = list(map(lambda items: self.__tupleToScalaTuple2(items), options))
optionIterables = gateway.jvm.scala.collection.JavaConversions.collectionAsScalaIterable(optionTuples)
defaultCheckedIterables = gateway.jvm.scala.collection.JavaConversions.collectionAsScalaIterable(defaultChecked)