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'

### 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 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'
  • Loading branch information
zjffdu committed Mar 20, 2018
1 parent 2a5960b commit 67582b8
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 67582b8

Please sign in to comment.