zjffdu commented on a change in pull request #2649: [ZEPPELIN-3033] IPYNB
import/export
URL: https://github.com/apache/zeppelin/pull/2649#discussion_r317426149
##########
File path:
zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java
##########
@@ -1128,9 +1135,24 @@ public void onSuccess(Note note, ServiceContext
context) throws IOException {
});
}
+ protected void convertNote(NotebookSocket conn, Message fromMessage) throws
IOException {
+ String note = gson.toJson(fromMessage.get("note"));
+
+ Message resp = new Message(OP.CONVERT_NOTE_NBFORMAT)
+ .put("nbformat", new JupyterUtil().getNbformat(note))
+ .put("name", fromMessage.get("name"));
+
+ conn.send(serializeMessage(resp));
+ }
+
protected Note importNote(NotebookSocket conn, Message fromMessage) throws
IOException {
+ String noteJson;
String noteName = (String) ((Map) fromMessage.get("note")).get("name");
- String noteJson = gson.toJson(fromMessage.get("note"));
+ if (((Map) fromMessage.get("note")).get("cells") == null) {
Review comment:
Add one line of comment to explain how we determine whether it is zeppelin
note or jupyter note
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services