This is an automated email from the ASF dual-hosted git repository.

zjffdu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zeppelin.git


The following commit(s) were added to refs/heads/master by this push:
     new fd89893  [minor] Add test for z.show(df, show_index=True)
fd89893 is described below

commit fd8989334b825c1ce2dee180bce6f2cba04f73f9
Author: Jeff Zhang <zjf...@apache.org>
AuthorDate: Tue Feb 18 09:55:00 2020 +0800

    [minor] Add test for z.show(df, show_index=True)
---
 .../apache/zeppelin/python/BasePythonInterpreterTest.java | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git 
a/python/src/test/java/org/apache/zeppelin/python/BasePythonInterpreterTest.java
 
b/python/src/test/java/org/apache/zeppelin/python/BasePythonInterpreterTest.java
index 27336a8..66ad5f6 100644
--- 
a/python/src/test/java/org/apache/zeppelin/python/BasePythonInterpreterTest.java
+++ 
b/python/src/test/java/org/apache/zeppelin/python/BasePythonInterpreterTest.java
@@ -322,6 +322,21 @@ public abstract class BasePythonInterpreterTest extends 
ConcurrentTestCase {
     assertEquals("<font color=red>Results are limited by 3.</font>\n",
         interpreterResultMessages.get(1).getData());
 
+    // z.show(df, show_index=True)
+    context = getInterpreterContext();
+    result = interpreter.interpret("import pandas as pd\n" +
+                    "df = pd.DataFrame({'id':[1,2,3], 
'name':['a','b','c']})\nz.show(df, show_index=True)",
+            context);
+    assertEquals(context.out.toInterpreterResultMessage().toString(),
+            InterpreterResult.Code.SUCCESS, result.code());
+    interpreterResultMessages = context.out.toInterpreterResultMessage();
+    assertEquals(1, interpreterResultMessages.size());
+    assertEquals(InterpreterResult.Type.TABLE, 
interpreterResultMessages.get(0).getType());
+    assertEquals("\tid\tname\n" +
+            "%html <strong>0</strong>\t1\ta\n" +
+            "%html <strong>1</strong>\t2\tb\n" +
+            "%html <strong>2</strong>\t3\tc\n", 
interpreterResultMessages.get(0).getData());
+
     // z.show(matplotlib)
     context = getInterpreterContext();
     result = interpreter.interpret("import matplotlib.pyplot as plt\n" +

Reply via email to