zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jongy...@apache.org
Subject zeppelin git commit: [ZEPPELIN-2315] (bug) new note.json is overwritten by old note.json (master, branch-0.7)
Date Tue, 18 Apr 2017 06:57:32 GMT
Repository: zeppelin
Updated Branches:
  refs/heads/branch-0.7 d742b7e68 -> c9f2c5fb2


[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 <1amb4a@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

(cherry picked from commit 33663941c5ca544b0922d7093c8a118d8c3fce3f)
Signed-off-by: Jongyoul Lee <jongyoul@apache.org>


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

Branch: refs/heads/branch-0.7
Commit: c9f2c5fb2d97558e0e44da40521ffdc5fbe5738b
Parents: d742b7e
Author: 1ambda <1amb4a@gmail.com>
Authored: Mon Apr 17 17:08:41 2017 +0900
Committer: Jongyoul Lee <jongyoul@apache.org>
Committed: Tue Apr 18 15:57:27 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/c9f2c5fb/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 c399a95..1885594 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);


Mime
View raw message