zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zjf...@apache.org
Subject zeppelin git commit: ZEPPELIN-3290. Unnecessary message 'IPython is available, use IPython for PySparkInterpreter'
Date Tue, 20 Mar 2018 06:09:36 GMT
Repository: zeppelin
Updated Branches:
  refs/heads/branch-0.8 714eb963d -> 4e2216477


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 <zjffdu@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'

(cherry picked from commit 67582b87ecd61f661aaebdc66aea817ff2fd2c7f)
Signed-off-by: Jeff Zhang <zjffdu@apache.org>


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

Branch: refs/heads/branch-0.8
Commit: 4e2216477a6f9787d3b0cd57fef9debdbfd26d16
Parents: 714eb96
Author: Jeff Zhang <zjffdu@apache.org>
Authored: Tue Mar 20 09:24:20 2018 +0800
Committer: Jeff Zhang <zjffdu@apache.org>
Committed: Tue Mar 20 14:09:28 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/4e221647/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/4e221647/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) {


Mime
View raw message