fixed jay_merge_add

This commit is contained in:
2024-10-20 18:57:29 +02:00
parent 7eb0acc2f3
commit 1598bf56c3
2 changed files with 32 additions and 4 deletions
+3 -2
View File
@@ -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))