You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by zj...@apache.org on 2018/03/20 06:09:20 UTC

zeppelin git commit: ZEPPELIN-3290. Unnecessary message 'IPython is available, use IPython for PySparkInterpreter'

Repository: zeppelin
Updated Branches:
  refs/heads/master 2a5960bd5 -> 67582b87e


ZEPPELIN-3290. Unnecessary message 'IPython is available, use IPython for PySparkInterpreter'

### What is this PR for?
Trivial PR for removing the unnecessary message

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

### Todos
* [ ] - Task

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

### 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 <zj...@apache.org>

Closes #2882 from zjffdu/ZEPPELIN-3290 and squashes the following commits:

7bf8d6e [Jeff Zhang] ZEPPELIN-3290. Unnecessary message 'IPython is available, use IPython for PySparkInterpreter'


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

Branch: refs/heads/master
Commit: 67582b87ecd61f661aaebdc66aea817ff2fd2c7f
Parents: 2a5960b
Author: Jeff Zhang <zj...@apache.org>
Authored: Tue Mar 20 09:24:20 2018 +0800
Committer: Jeff Zhang <zj...@apache.org>
Committed: Tue Mar 20 14:09:14 2018 +0800

----------------------------------------------------------------------
 .../zeppelin/python/PythonInterpreter.java      | 23 +++++---------------
 .../zeppelin/spark/PySparkInterpreter.java      | 23 +++++---------------
 2 files changed, 10 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/67582b87/python/src/main/java/org/apache/zeppelin/python/PythonInterpreter.java
----------------------------------------------------------------------
diff --git a/python/src/main/java/org/apache/zeppelin/python/PythonInterpreter.java b/python/src/main/java/org/apache/zeppelin/python/PythonInterpreter.java
index f646de3..fab2ed9 100644
--- a/python/src/main/java/org/apache/zeppelin/python/PythonInterpreter.java
+++ b/python/src/main/java/org/apache/zeppelin/python/PythonInterpreter.java
@@ -232,30 +232,17 @@ public class PythonInterpreter extends Interpreter implements ExecuteResultHandl
         StringUtils.isEmpty(iPythonInterpreter.checkIPythonPrerequisite(getPythonBindPath()))) {
       try {
         iPythonInterpreter.open();
-        if (InterpreterContext.get() != null) {
-          InterpreterContext.get().out.write(("IPython is available, " +
-              "use IPython for PythonInterpreter\n")
-              .getBytes());
-        }
-        LOG.info("Use IPythonInterpreter to replace PythonInterpreter");
+        LOG.info("IPython is available, Use IPythonInterpreter to replace PythonInterpreter");
         return;
       } catch (Exception e) {
         iPythonInterpreter = null;
+        LOG.warn("Fail to open IPythonInterpreter", e);
       }
     }
-    // reset iPythonInterpreter to null
-    iPythonInterpreter = null;
-
-    try {
-      if (InterpreterContext.get() != null) {
-        InterpreterContext.get().out.write(("IPython is not available, " +
-            "use the native PythonInterpreter\n")
-            .getBytes());
-      }
-    } catch (IOException e) {
-      LOG.warn("Fail to write InterpreterOutput", e.getMessage());
-    }
 
+    // reset iPythonInterpreter to null as it is not available
+    iPythonInterpreter = null;
+    LOG.info("IPython is not available, use the native PythonInterpreter");
     // Add matplotlib display hook
     InterpreterGroup intpGroup = getInterpreterGroup();
     if (intpGroup != null && intpGroup.getInterpreterHookRegistry() != null) {

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/67582b87/spark/interpreter/src/main/java/org/apache/zeppelin/spark/PySparkInterpreter.java
----------------------------------------------------------------------
diff --git a/spark/interpreter/src/main/java/org/apache/zeppelin/spark/PySparkInterpreter.java b/spark/interpreter/src/main/java/org/apache/zeppelin/spark/PySparkInterpreter.java
index bd2a30c..a838667 100644
--- a/spark/interpreter/src/main/java/org/apache/zeppelin/spark/PySparkInterpreter.java
+++ b/spark/interpreter/src/main/java/org/apache/zeppelin/spark/PySparkInterpreter.java
@@ -126,30 +126,17 @@ public class PySparkInterpreter extends Interpreter implements ExecuteResultHand
             iPySparkInterpreter.checkIPythonPrerequisite(getPythonExec(getProperties())))) {
       try {
         iPySparkInterpreter.open();
-        if (InterpreterContext.get() != null) {
-          // don't print it when it is in testing, just for easy output check in test.
-          InterpreterContext.get().out.write(("IPython is available, " +
-              "use IPython for PySparkInterpreter\n")
-              .getBytes());
-        }
-        LOGGER.info("Use IPySparkInterpreter to replace PySparkInterpreter");
+        LOGGER.info("IPython is available, Use IPySparkInterpreter to replace PySparkInterpreter");
         return;
       } catch (Exception e) {
+        iPySparkInterpreter = null;
         LOGGER.warn("Fail to open IPySparkInterpreter", e);
       }
     }
-    iPySparkInterpreter = null;
-    if (getProperty("zeppelin.pyspark.useIPython", "true").equals("true")) {
-      // don't print it when it is in testing, just for easy output check in test.
-      try {
-        InterpreterContext.get().out.write(("IPython is not available, " +
-            "use the native PySparkInterpreter\n")
-            .getBytes());
-      } catch (IOException e) {
-        LOGGER.warn("Fail to write InterpreterOutput", e);
-      }
-    }
 
+    // reset iPySparkInterpreter to null as it is not available
+    iPySparkInterpreter = null;
+    LOGGER.info("IPython is not available, use the native PySparkInterpreter\n");
     // Add matplotlib display hook
     InterpreterGroup intpGroup = getInterpreterGroup();
     if (intpGroup != null && intpGroup.getInterpreterHookRegistry() != null) {