Repository: zeppelin
Updated Branches:
  refs/heads/master f32651e51 -> 33663941c


[ZEPPELIN-2315] (bug) new note.json is overwritten by old note.json (master, 
branch-0.7)

### What is this PR for?

- `note.json` is converted every time
- as a result, changes in `note.json` is overwritten by old `note.json`

Occurs in **0.8.0-SNAPSHOT** and **branch-0.7**

### What type of PR is it?
[Bug Fix]

### Todos

NONE

### What is the Jira issue?

[ZEPPELIN-2315](https://issues.apache.org/jira/browse/ZEPPELIN-2315)

### How should this be tested?

1. create a note in 0.6.0 which including graph
2. migrate it to 0.7.0+ (just copy dir)
3. open in Zeppelin
4. click other graph type rather than table (e.g `scatter chart`)
5. restart
7. should see the last change (graph) is persisted

### 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: 1ambda <1am...@gmail.com>

Closes #2256 from 1ambda/ZEPPELIN-2315/should-convert-old-notebook-only-once 
and squashes the following commits:

4e77c0a8b [1ambda] fix: Convert old notebook format only once


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/33663941
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/33663941
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/33663941

Branch: refs/heads/master
Commit: 33663941c5ca544b0922d7093c8a118d8c3fce3f
Parents: f32651e
Author: 1ambda <1am...@gmail.com>
Authored: Mon Apr 17 17:08:41 2017 +0900
Committer: Jongyoul Lee <jongy...@apache.org>
Committed: Tue Apr 18 15:57:14 2017 +0900

----------------------------------------------------------------------
 .../src/main/java/org/apache/zeppelin/notebook/Notebook.java     | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/33663941/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Notebook.java
----------------------------------------------------------------------
diff --git 
a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Notebook.java 
b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Notebook.java
index e7f7e49..de48bef 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Notebook.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Notebook.java
@@ -414,6 +414,10 @@ public class Notebook implements NoteEventListener {
   public void convertFromSingleResultToMultipleResultsFormat(Note note) {
     for (Paragraph p : note.paragraphs) {
       Object ret = p.getPreviousResultFormat();
+      if (ret != null && p.results != null) {
+        continue; // already converted
+      }
+
       try {
         if (ret != null && ret instanceof Map) {
           Map r = ((Map) ret);

Reply via email to