Skip to content

Commit

Permalink
ZEPPELIN-3290. Unnecessary message 'IPython is available, use IPython…
Browse files Browse the repository at this point in the history
… for PySparkInterpreter'

Trivial PR for removing the unnecessary message

[Improvement]

* [ ] - Task

* https://issues.apache.org/jira/browse/ZEPPELIN-3290

* CI pass

* 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 apache#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 67582b8)
Signed-off-by: Jeff Zhang <zjffdu@apache.org>
(cherry picked from commit 4e22164)

Change-Id: Iddca2c62b579c6d0fc56eb95ea18540a90d0c8a4
  • Loading branch information
zjffdu committed Mar 22, 2018
1 parent cc18236 commit 6aff512
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 36 deletions.
Expand Up @@ -232,30 +232,17 @@ public void open() throws InterpreterException {
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) {
Expand Down
Expand Up @@ -126,30 +126,17 @@ public void open() throws InterpreterException {
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) {
Expand Down

0 comments on commit 6aff512

Please sign in to comment.