Repository: zeppelin
Updated Branches:
  refs/heads/master 514ba659b -> 9ec6eb5a4


ZEPPELIN-3328. Add plotting test for LivyInterpreter

### What is this PR for?
Add plotting for LivyInterpreter (Python & R)

### What type of PR is it?
[Improvement]

### Todos
* [ ] - Task

### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-3328

### How should this be tested?
* CI pass

### 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: Jeff Zhang <zjf...@apache.org>

Closes #2866 from zjffdu/ZEPPELIN-3328 and squashes the following commits:

fd394e3 [Jeff Zhang] ZEPPELIN-3328. Add plotting test for LivyInterpreter


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

Branch: refs/heads/master
Commit: 9ec6eb5a4e422e4ac73a97e38e47512811d5b29d
Parents: 514ba65
Author: Jeff Zhang <zjf...@apache.org>
Authored: Wed Mar 14 13:27:09 2018 +0800
Committer: Jeff Zhang <zjf...@apache.org>
Committed: Wed Mar 14 14:44:06 2018 +0800

----------------------------------------------------------------------
 .../apache/zeppelin/livy/LivyInterpreterIT.java | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/9ec6eb5a/livy/src/test/java/org/apache/zeppelin/livy/LivyInterpreterIT.java
----------------------------------------------------------------------
diff --git a/livy/src/test/java/org/apache/zeppelin/livy/LivyInterpreterIT.java 
b/livy/src/test/java/org/apache/zeppelin/livy/LivyInterpreterIT.java
index 0c8bea9..c7fbc8d 100644
--- a/livy/src/test/java/org/apache/zeppelin/livy/LivyInterpreterIT.java
+++ b/livy/src/test/java/org/apache/zeppelin/livy/LivyInterpreterIT.java
@@ -750,6 +750,26 @@ public class LivyInterpreterIT {
         assertEquals(1, result.message().size());
         assertTrue(result.message().get(0).getData().contains("col_1 col_2\n1 
hello    20"));
       }
+
+      // test plotting of python
+      result = pysparkInterpreter.interpret(
+          "import matplotlib.pyplot as plt\n" +
+          "plt.switch_backend('agg')\n" +
+          "data=[1,2,3,4]\n" +
+          "plt.figure()\n" +
+          "plt.plot(data)\n" +
+          "%matplot plt", context);
+      assertEquals(InterpreterResult.Code.SUCCESS, result.code());
+      assertEquals(1, result.message().size());
+      assertEquals(InterpreterResult.Type.IMG, 
result.message().get(0).getType());
+
+      // test plotting of R
+      result = sparkRInterpreter.interpret(
+          "hist(mtcars$mpg)", context);
+      assertEquals(InterpreterResult.Code.SUCCESS, result.code());
+      assertEquals(1, result.message().size());
+      assertEquals(InterpreterResult.Type.IMG, 
result.message().get(0).getType());
+
     } finally {
       sparkInterpreter.close();
       sqlInterpreter.close();

Reply via email to