fixed jay_merge_add
This commit is contained in:
+3
-2
@@ -2,6 +2,7 @@ import json
|
||||
from copy import deepcopy
|
||||
from jay_diff import jay_diff_full, jay_merge_full
|
||||
|
||||
|
||||
def deep_diff(data, temp_data):
|
||||
new_data = {}
|
||||
for k in data.keys():
|
||||
@@ -50,9 +51,9 @@ if __name__ == '__main__':
|
||||
diffed_list = []
|
||||
last = {}
|
||||
for s in src:
|
||||
diffed = jay_diff_full(last, s, combine_upd_add=diff_mode_update_add)
|
||||
print(f"Old: {last}")
|
||||
print(f"New: {s}")
|
||||
diffed = jay_diff_full(last, s, combine_upd_add=diff_mode_update_add)
|
||||
print(f"Diffed: {diffed}")
|
||||
diffed_list.append(deepcopy(diffed))
|
||||
last = deepcopy(s)
|
||||
@@ -60,9 +61,9 @@ if __name__ == '__main__':
|
||||
merged_list = []
|
||||
last = {}
|
||||
for d in diffed_list:
|
||||
merged = jay_merge_full(last, d)
|
||||
print(f"Old: {last}")
|
||||
print(f"Diff: {d}")
|
||||
merged = jay_merge_full(last, d)
|
||||
print(f"Merged: {merged}")
|
||||
last = deepcopy(merged)
|
||||
merged_list.append(deepcopy(merged))
|
||||
|
||||
Reference in New Issue
Block a user