Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions interpreter-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>none</phase>
<configuration>
<skip>true</skip>
</configuration>
</execution>

<execution>
<id>copy-interpreter-dependencies</id>
<phase>package</phase>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void onNext(ExecuteResponse executeResponse) {
LOGGER.debug("Interpreter Streaming Output: " + executeResponse.getOutput());
if (isPreviousOutputImage) {
// add '\n' when switch from image to text
interpreterOutput.write("\n".getBytes());
interpreterOutput.write("\n%text ".getBytes());
}
isPreviousOutputImage = false;
interpreterOutput.write(executeResponse.getOutput().getBytes());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ protected Map<String, String> setupIPythonEnv() throws IOException {
} else {
envs.put("PYTHONPATH", additionalPythonPath);
}
LOGGER.info("PYTHONPATH:" + envs.get("PYTHONPATH"));
return envs;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,24 @@ public void run() {
// the order of IMAGE and TEXT is not determined
// check there must be one IMAGE output
boolean hasImageOutput = false;
boolean hasLineText = false;
boolean hasFigureText = false;
for (InterpreterResultMessage msg : interpreterResultMessages) {
if (msg.getType() == InterpreterResult.Type.IMG) {
hasImageOutput = true;
}
if (msg.getType() == InterpreterResult.Type.TEXT
&& msg.getData().contains("matplotlib.lines.Line2D")) {
hasLineText = true;
}
if (msg.getType() == InterpreterResult.Type.TEXT
&& msg.getData().contains("matplotlib.figure.Figure")) {
hasFigureText = true;
}
}
assertTrue("No Image Output", hasImageOutput);
assertTrue("No Line Text", hasLineText);
assertTrue("No Figure Text", hasFigureText);

// bokeh
// bokeh initialization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public void run() {
List<InterpreterResultMessage> interpreterResultMessages = null;
try {
interpreterResultMessages = context2.out.getInterpreterResultMessages();
assertTrue(interpreterResultMessages.get(0).getData().contains("cancelled"));
assertTrue(interpreterResultMessages.get(0).getData().contains("KeyboardInterrupt"));
} catch (IOException e) {
e.printStackTrace();
}
Expand Down Expand Up @@ -180,7 +180,7 @@ public void run() {
"ssc.start()\n" +
"time.sleep(6)\n" +
"ssc.stop(stopSparkContext=False, stopGraceFully=True)", context);
Thread.sleep(100);
Thread.sleep(1000);
assertEquals(InterpreterResult.Code.SUCCESS, result.code());
interpreterResultMessages = context.out.getInterpreterResultMessages();
assertEquals(1, interpreterResultMessages.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ public void onMessage(NotebookSocket conn, String msg) {
break;
}
} catch (Exception e) {
LOG.error("Can't handle message", e);
LOG.error("Can't handle message: " + msg, e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ public RemoteInterpreterEvent call(Client client) throws Exception {
listener.onParaInfosReceived(noteId, paraId, settingId, paraInfos);
}
}
logger.debug("Event from remote process {}", event.getType());
} catch (Exception e) {
logger.error("Can't handle event " + event, e);
}
Expand Down