-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[ZEPPELIN-905] fix failed notebook import bug #933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
f8620cf
91da565
32c9172
04e777c
27ff2ef
e51889d
3b16f02
571e8fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -308,6 +308,31 @@ public void testAutoRestartInterpreterAfterSchedule() throws InterruptedExceptio | |
| notebook.refreshCron(note.id()); | ||
| } | ||
|
|
||
| @Test | ||
| public void testExportAndImportNote() throws IOException, CloneNotSupportedException, | ||
| InterruptedException { | ||
| Note note = notebook.createNote(); | ||
| note.getNoteReplLoader().setInterpreters(factory.getDefaultInterpreterSettingList()); | ||
|
|
||
| final Paragraph p = note.addParagraph(); | ||
| String simpleText = "hello world"; | ||
| p.setText(simpleText); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about make I think easiest way to set arbitrary object to Job.result is making Job.setResult() public.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Leemoonsoo I cannot agree that's the best way to do that..
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @swkimme About changing Job.result into InterpreterResult, we'll need to consider import note.json created from previous version of Zeppelin. They'll still have Job.result with string type. |
||
|
|
||
| note.runAll(); | ||
| while(p.isTerminated()==false || p.getResult()==null) Thread.yield(); | ||
|
|
||
| String exportedNoteJson = notebook.exportNote(note.getId()); | ||
|
|
||
| Note importedNote = notebook.importNote(exportedNoteJson, "Title"); | ||
|
|
||
| Paragraph p2 = importedNote.getParagraphs().get(0); | ||
|
|
||
| // Test | ||
| assertEquals(p.getId(), p2.getId()); | ||
| assertEquals(p.text, p2.text); | ||
| assertEquals(p.getResult().message(), p2.getResult().message()); | ||
| } | ||
|
|
||
| @Test | ||
| public void testCloneNote() throws IOException, CloneNotSupportedException, | ||
| InterruptedException { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A nitpick, but may be we could leave some clues for the person who is going to read it next time.
Instead of stating the fact that we are ignoring exception, we could write the reason or case when\why it happens to be OK to do so i.e
would make sense, how do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and, I think we should log the exception