-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[HOTFIX] Dynamic form in python interpreter #2155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HOTFIX] Dynamic form in python interpreter #2155
Conversation
12c97e1 to
c5e584a
Compare
felixcheung
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one question, LGTM otherwise
| if sys.version_info >= (3, 4) and sys.version_info < (3, 5): | ||
| byte_str = bytes("data:image/%s;base64," %fmt, "utf-8") | ||
| else: | ||
| byte_str = b"data:image/%s;base64," %fmt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to be concerned with Python 2.x here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python 2.x works fine. 3.4 is only exception as far as i know.
|
Tested both with & without this patch. It works well now. |
|
Merge to master and branch-0.7 as a hotfix. |
### What is this PR for? #2106 rewrote python interpreter. But dynamic form feature is not rewritten correctly. ### What type of PR is it? Hot Fix ### Todos * [x] - Bring dynamic form back ### What is the Jira issue? #2106 ### How should this be tested? run ``` %python print("Hello "+z.input("name", "sun")) ``` ``` %python print("Hello "+z.select("day", [("1","mon"), ("2","tue"), ("3","wed"), ("4","thurs"), ("5","fri"), ("6","sat"), ("7","sun")])) ``` ``` %python options = [("apple","Apple"), ("banana","Banana"), ("orange","Orange")] print("Hello "+ " and ".join(z.checkbox("fruit", options, ["apple"]))) ``` ### 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 <moon@apache.org> Closes #2155 from Leemoonsoo/python_get_interpreter_context and squashes the following commits: c5e584a [Lee moon soo] fix matplotlib display error on python 3.4 3e6603b [Lee moon soo] correctly handle zeppelin.python property. 5be8db4 [Lee moon soo] Expose a method to get InterpreterOutput, so user can call InterpreterOutput.clear() a405a93 [Lee moon soo] implement dynamic form (cherry picked from commit 1972a58) Signed-off-by: Lee moon soo <moon@apache.org>
### What is this PR for? apache#2106 rewrote python interpreter. But dynamic form feature is not rewritten correctly. ### What type of PR is it? Hot Fix ### Todos * [x] - Bring dynamic form back ### What is the Jira issue? apache#2106 ### How should this be tested? run ``` %python print("Hello "+z.input("name", "sun")) ``` ``` %python print("Hello "+z.select("day", [("1","mon"), ("2","tue"), ("3","wed"), ("4","thurs"), ("5","fri"), ("6","sat"), ("7","sun")])) ``` ``` %python options = [("apple","Apple"), ("banana","Banana"), ("orange","Orange")] print("Hello "+ " and ".join(z.checkbox("fruit", options, ["apple"]))) ``` ### 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 <moon@apache.org> Closes apache#2155 from Leemoonsoo/python_get_interpreter_context and squashes the following commits: c5e584a [Lee moon soo] fix matplotlib display error on python 3.4 3e6603b [Lee moon soo] correctly handle zeppelin.python property. 5be8db4 [Lee moon soo] Expose a method to get InterpreterOutput, so user can call InterpreterOutput.clear() a405a93 [Lee moon soo] implement dynamic form
### What is this PR for? apache#2106 rewrote python interpreter. But dynamic form feature is not rewritten correctly. ### What type of PR is it? Hot Fix ### Todos * [x] - Bring dynamic form back ### What is the Jira issue? apache#2106 ### How should this be tested? run ``` %python print("Hello "+z.input("name", "sun")) ``` ``` %python print("Hello "+z.select("day", [("1","mon"), ("2","tue"), ("3","wed"), ("4","thurs"), ("5","fri"), ("6","sat"), ("7","sun")])) ``` ``` %python options = [("apple","Apple"), ("banana","Banana"), ("orange","Orange")] print("Hello "+ " and ".join(z.checkbox("fruit", options, ["apple"]))) ``` ### 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 <moon@apache.org> Closes apache#2155 from Leemoonsoo/python_get_interpreter_context and squashes the following commits: c5e584a [Lee moon soo] fix matplotlib display error on python 3.4 3e6603b [Lee moon soo] correctly handle zeppelin.python property. 5be8db4 [Lee moon soo] Expose a method to get InterpreterOutput, so user can call InterpreterOutput.clear() a405a93 [Lee moon soo] implement dynamic form
What is this PR for?
#2106 rewrote python interpreter. But dynamic form feature is not rewritten correctly.
What type of PR is it?
Hot Fix
Todos
What is the Jira issue?
#2106
How should this be tested?
run
Questions: