Skip to content

Commit 9b5aac8

Browse files
committed
RDBC-644 JSON Comparer won't consider identity property when looking for changes
1 parent b215aee commit 9b5aac8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ravendb/json/json_operation.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,15 @@ def compare_json(
4848
old_json_props = set(original_json.keys())
4949
new_json_props = set(new_json.keys())
5050

51+
# todo: Discuss about that condition - add/del Id causes changes
52+
if "Id" in old_json_props:
53+
old_json_props.remove("Id")
54+
if "Id" in new_json_props:
55+
new_json_props.remove("Id")
56+
5157
new_fields = new_json_props - old_json_props
5258
removed_fields = old_json_props - new_json_props
5359

54-
# todo: Discuss about that condition - add/del Id causes changes
55-
removed_fields.discard("Id")
56-
5760
for field in removed_fields:
5861
if changes is None:
5962
return True

0 commit comments

Comments
 (0)