GeezerVison is showing github.com — Include type info and change the "unknown" value for flat rows to · mirror-dump/deepdiff@54ebdb5
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: deepdiff/delta.py +31-7Lines changed: 31 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -878,7 +878,7 @@ def to_dict(self): | 878 | 878 | return dict(self.diff) | 879 | 879 |
| 880 | 880 | @staticmethod | 881 | | - def _get_flat_row(action, info, _parse_path, keys_and_funcs): | | 881 | + def _get_flat_row(action, info, _parse_path, keys_and_funcs, report_type_changes=True): | 882 | 882 | for path, details in info.items(): | 883 | 883 | row = {'path': _parse_path(path), 'action': action} | 884 | 884 | for key, new_key, func in keys_and_funcs: | @@ -887,6 +887,11 @@ def _get_flat_row(action, info, _parse_path, keys_and_funcs): | 887 | 887 | row[new_key] = func(details[key]) | 888 | 888 | else: | 889 | 889 | row[new_key] = details[key] | | 890 | + if report_type_changes: | | 891 | + if 'value' in row and 'type' not in row: | | 892 | + row['type'] = type(row['value']) | | 893 | + if 'old_value' in row and 'old_type' not in row: | | 894 | + row['old_type'] = type(row['old_value']) | 890 | 895 | yield FlatDeltaRow(**row) | 891 | 896 |
| 892 | 897 | @staticmethod | @@ -1060,6 +1065,9 @@ def to_flat_rows(self, include_action_in_path=False, report_type_changes=True) - | 1060 | 1065 | 'iterable_items_removed_at_indexes': 'unordered_iterable_item_removed', | 1061 | 1066 | } | 1062 | 1067 | for action, info in self.diff.items(): | | 1068 | + if action == '_iterable_opcodes': | | 1069 | + result.extend(self._flatten_iterable_opcodes()) | | 1070 | + continue | 1063 | 1071 | if action.startswith('_'): | 1064 | 1072 | continue | 1065 | 1073 | if action in FLATTENING_NEW_ACTION_MAP: | @@ -1072,12 +1080,20 @@ def to_flat_rows(self, include_action_in_path=False, report_type_changes=True) - | 1072 | 1080 | path2.append((index, 'GET')) | 1073 | 1081 | else: | 1074 | 1082 | path2.append(index) | 1075 | | - result.append(FlatDeltaRow(path=path2, value=value, action=new_action)) | | 1083 | + if report_type_changes: | | 1084 | + row = FlatDeltaRow(path=path2, value=value, action=new_action, type=type(value)) | | 1085 | + else: | | 1086 | + row = FlatDeltaRow(path=path2, value=value, action=new_action) | | 1087 | + result.append(row) | 1076 | 1088 | elif action in {'set_item_added', 'set_item_removed'}: | 1077 | 1089 | for path, values in info.items(): | 1078 | 1090 | path = _parse_path(path) | 1079 | 1091 | for value in values: | 1080 | | - result.append(FlatDeltaRow(path=path, value=value, action=action)) | | 1092 | + if report_type_changes: | | 1093 | + row = FlatDeltaRow(path=path, value=value, action=action, type=type(value)) | | 1094 | + else: | | 1095 | + row = FlatDeltaRow(path=path, value=value, action=action) | | 1096 | + result.append(row) | 1081 | 1097 | elif action == 'dictionary_item_added': | 1082 | 1098 | for path, value in info.items(): | 1083 | 1099 | path = _parse_path(path) | @@ -1092,14 +1108,22 @@ def to_flat_rows(self, include_action_in_path=False, report_type_changes=True) - | 1092 | 1108 | elif isinstance(value, set) and len(value) == 1: | 1093 | 1109 | value = value.pop() | 1094 | 1110 | action = 'set_item_added' | 1095 | | - result.append(FlatDeltaRow(path=path, value=value, action=action)) | | 1111 | + if report_type_changes: | | 1112 | + row = FlatDeltaRow(path=path, value=value, action=action, type=type(value)) | | 1113 | + else: | | 1114 | + row = FlatDeltaRow(path=path, value=value, action=action) | | 1115 | + result.append(row) | 1096 | 1116 | elif action in { | 1097 | 1117 | 'dictionary_item_removed', 'iterable_item_added', | 1098 | 1118 | 'iterable_item_removed', 'attribute_removed', 'attribute_added' | 1099 | 1119 | }: | 1100 | 1120 | for path, value in info.items(): | 1101 | 1121 | path = _parse_path(path) | 1102 | | - result.append(FlatDeltaRow(path=path, value=value, action=action)) | | 1122 | + if report_type_changes: | | 1123 | + row = FlatDeltaRow(path=path, value=value, action=action, type=type(value)) | | 1124 | + else: | | 1125 | + row = FlatDeltaRow(path=path, value=value, action=action) | | 1126 | + result.append(row) | 1103 | 1127 | elif action == 'type_changes': | 1104 | 1128 | if not report_type_changes: | 1105 | 1129 | action = 'values_changed' | @@ -1109,16 +1133,16 @@ def to_flat_rows(self, include_action_in_path=False, report_type_changes=True) - | 1109 | 1133 | info=info, | 1110 | 1134 | _parse_path=_parse_path, | 1111 | 1135 | keys_and_funcs=keys_and_funcs, | | 1136 | + report_type_changes=report_type_changes, | 1112 | 1137 | ): | 1113 | 1138 | result.append(row) | 1114 | | - elif action == '_iterable_opcodes': | 1115 | | - result.extend(self._flatten_iterable_opcodes()) | 1116 | 1139 | else: | 1117 | 1140 | for row in self._get_flat_row( | 1118 | 1141 | action=action, | 1119 | 1142 | info=info, | 1120 | 1143 | _parse_path=_parse_path, | 1121 | 1144 | keys_and_funcs=keys_and_funcs, | | 1145 | + report_type_changes=report_type_changes, | 1122 | 1146 | ): | 1123 | 1147 | result.append(row) | 1124 | 1148 | return result | |
Collapse file Copy file name to clipboardExpand all lines: deepdiff/helper.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -771,7 +771,7 @@ class FlatDataAction(str, enum.Enum): | 771 | 771 | unordered_iterable_item_removed = 'unordered_iterable_item_removed' | 772 | 772 |
| 773 | 773 |
| 774 | | -UnkownValueCode = '*-UNKNOWN-*' | | 774 | +UnkownValueCode = 'unknown___' | 775 | 775 |
| 776 | 776 |
| 777 | 777 | class FlatDeltaRow(NamedTuple): | |
Collapse file Copy file name to clipboardExpand all lines: docs/serialization.rst +14-14Lines changed: 14 additions & 14 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -181,7 +181,7 @@ Flat Row Specs: | 181 | 181 | unordered_iterable_item_removed = 'unordered_iterable_item_removed' | 182 | 182 |
| 183 | 183 |
| 184 | | - UnkownValueCode = '*-UNKNOWN-*' | | 184 | + UnkownValueCode = 'unknown___' | 185 | 185 |
| 186 | 186 |
| 187 | 187 | class FlatDeltaRow(NamedTuple): | @@ -205,7 +205,7 @@ Delta Serialize To Flat Dictionaries | 205 | 205 |
| 206 | 206 | Sometimes, it is desired to serialize a :ref:`delta_label` object to a list of flat dictionaries. For example, to store them in relation databases. In that case, you can use the Delta.to_flat_dicts to achieve the desired outcome. | 207 | 207 |
| 208 | | -Since None is a valid value, we use a special hard-coded string to signify "unkown": '*-UNKNOWN-*' | | 208 | +Since None is a valid value, we use a special hard-coded string to signify "unkown": 'unknown___' | 209 | 209 |
| 210 | 210 | .. note:: | 211 | 211 | Many new keys are added to the flat dicts in DeepDiff 7.0.0 | @@ -226,25 +226,25 @@ For example: | 226 | 226 | >>> pprint(flat_dicts, indent=2) | 227 | 227 | [ { 'action': 'dictionary_item_added', | 228 | 228 | 'new_path': None, | 229 | | - 'old_type': '*-UNKNOWN-*', | 230 | | - 'old_value': '*-UNKNOWN-*', | | 229 | + 'old_type': 'unknown___', | | 230 | + 'old_value': 'unknown___', | 231 | 231 | 'path': ['field2', 'key2'], | 232 | 232 | 't1_from_index': None, | 233 | 233 | 't1_to_index': None, | 234 | 234 | 't2_from_index': None, | 235 | 235 | 't2_to_index': None, | 236 | | - 'type': '*-UNKNOWN-*', | | 236 | + 'type': 'unknown___', | 237 | 237 | 'value': 'value2'}, | 238 | 238 | { 'action': 'dictionary_item_removed', | 239 | 239 | 'new_path': None, | 240 | | - 'old_type': '*-UNKNOWN-*', | 241 | | - 'old_value': '*-UNKNOWN-*', | | 240 | + 'old_type': 'unknown___', | | 241 | + 'old_value': 'unknown___', | 242 | 242 | 'path': ['key1'], | 243 | 243 | 't1_from_index': None, | 244 | 244 | 't1_to_index': None, | 245 | 245 | 't2_from_index': None, | 246 | 246 | 't2_to_index': None, | 247 | | - 'type': '*-UNKNOWN-*', | | 247 | + 'type': 'unknown___', | 248 | 248 | 'value': 'value1'}] | 249 | 249 |
| 250 | 250 |
| @@ -261,25 +261,25 @@ Example 2: | 261 | 261 | >>> pprint(flat_dicts, indent=2) | 262 | 262 | [ { 'action': 'iterable_item_added', | 263 | 263 | 'new_path': None, | 264 | | - 'old_type': '*-UNKNOWN-*', | 265 | | - 'old_value': '*-UNKNOWN-*', | | 264 | + 'old_type': 'unknown___', | | 265 | + 'old_value': 'unknown___', | 266 | 266 | 'path': [2], | 267 | 267 | 't1_from_index': None, | 268 | 268 | 't1_to_index': None, | 269 | 269 | 't2_from_index': None, | 270 | 270 | 't2_to_index': None, | 271 | | - 'type': '*-UNKNOWN-*', | | 271 | + 'type': 'unknown___', | 272 | 272 | 'value': 'C'}, | 273 | 273 | { 'action': 'iterable_item_added', | 274 | 274 | 'new_path': None, | 275 | | - 'old_type': '*-UNKNOWN-*', | 276 | | - 'old_value': '*-UNKNOWN-*', | | 275 | + 'old_type': 'unknown___', | | 276 | + 'old_value': 'unknown___', | 277 | 277 | 'path': [3], | 278 | 278 | 't1_from_index': None, | 279 | 279 | 't1_to_index': None, | 280 | 280 | 't2_from_index': None, | 281 | 281 | 't2_to_index': None, | 282 | | - 'type': '*-UNKNOWN-*', | | 282 | + 'type': 'unknown___', | 283 | 283 | 'value': 'D'}] | 284 | 284 |
| 285 | 285 |
| |
Collapse file Copy file name to clipboardExpand all lines: tests/test_delta.py +47-40Lines changed: 47 additions & 40 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -73,8 +73,8 @@ def test_list_difference_add_delta(self): | 73 | 73 |
| 74 | 74 | flat_result1 = delta.to_flat_rows() | 75 | 75 | flat_expected1 = [ | 76 | | - FlatDeltaRow(path=[3], value=5, action='iterable_item_added'), | 77 | | - FlatDeltaRow(path=[2], value=3, action='iterable_item_added'), | | 76 | + FlatDeltaRow(path=[3], value=5, action='iterable_item_added', type=int), | | 77 | + FlatDeltaRow(path=[2], value=3, action='iterable_item_added', type=int), | 78 | 78 | ] | 79 | 79 |
| 80 | 80 | assert flat_expected1 == flat_result1 | @@ -291,9 +291,9 @@ def test_list_difference3_delta(self): | 291 | 291 |
| 292 | 292 | flat_result1 = delta.to_flat_rows() | 293 | 293 | flat_expected1 = [ | 294 | | - FlatDeltaRow(path=[4, 'b', 2], action='values_changed', value=2, old_value=5), | 295 | | - FlatDeltaRow(path=[4, 'b', 1], action='values_changed', value=3, old_value=2), | 296 | | - FlatDeltaRow(path=[4, 'b', 3], value=5, action='iterable_item_added'), | | 294 | + FlatDeltaRow(path=[4, 'b', 2], action='values_changed', value=2, old_value=5, type=int, old_type=int), | | 295 | + FlatDeltaRow(path=[4, 'b', 1], action='values_changed', value=3, old_value=2, type=int, old_type=int), | | 296 | + FlatDeltaRow(path=[4, 'b', 3], value=5, action='iterable_item_added', type=int), | 297 | 297 | ] | 298 | 298 |
| 299 | 299 | assert flat_expected1 == flat_result1 | @@ -332,9 +332,9 @@ def test_list_difference_delta_raises_error_if_prev_value_does_not_match(self): | 332 | 332 |
| 333 | 333 | flat_result2 = delta2.to_flat_rows() | 334 | 334 | flat_expected2 = [ | 335 | | - FlatDeltaRow(path=[2], action='values_changed', value=2, old_value=5), | 336 | | - FlatDeltaRow(path=[1], action='values_changed', value=3, old_value=2), | 337 | | - FlatDeltaRow(path=[3], value=5, action='iterable_item_added'), | | 335 | + FlatDeltaRow(path=[2], action='values_changed', value=2, old_value=5, type=int, old_type=int), | | 336 | + FlatDeltaRow(path=[1], action='values_changed', value=3, old_value=2, type=int, old_type=int), | | 337 | + FlatDeltaRow(path=[3], value=5, action='iterable_item_added', type=int), | 338 | 338 | ] | 339 | 339 |
| 340 | 340 | assert flat_expected2 == flat_result2 | @@ -363,8 +363,8 @@ def test_list_difference_delta1(self): | 363 | 363 |
| 364 | 364 | flat_result = delta.to_flat_rows() | 365 | 365 | flat_expected = [ | 366 | | - FlatDeltaRow(path=[4, 'b', 2], value='to_be_removed', action='iterable_item_removed'), | 367 | | - FlatDeltaRow(path=[4, 'b', 3], value='to_be_removed2', action='iterable_item_removed'), | | 366 | + FlatDeltaRow(path=[4, 'b', 2], value='to_be_removed', action='iterable_item_removed', type=str), | | 367 | + FlatDeltaRow(path=[4, 'b', 3], value='to_be_removed2', action='iterable_item_removed', type=str), | 368 | 368 | ] | 369 | 369 |
| 370 | 370 | assert flat_expected == flat_result | @@ -567,7 +567,8 @@ def compare_func(item1, item2, level=None): | 567 | 567 | 'professionalDesignation': '', | 568 | 568 | 'suffix': 'SR', | 569 | 569 | 'nameIdentifier': '00003'}, | 570 | | - action='unordered_iterable_item_added'), | | 570 | + action='unordered_iterable_item_added', | | 571 | + type=dict), | 571 | 572 | FlatDeltaRow(path=['individualNames', 1], | 572 | 573 | value={'firstName': 'John', | 573 | 574 | 'lastName': 'Doe', | @@ -577,7 +578,9 @@ def compare_func(item1, item2, level=None): | 577 | 578 | 'professionalDesignation': '', | 578 | 579 | 'suffix': 'SR', | 579 | 580 | 'nameIdentifier': '00002'}, | 580 | | - action='unordered_iterable_item_removed')] | | 581 | + action='unordered_iterable_item_removed', | | 582 | + type=dict), | | 583 | + ] | 581 | 584 |
| 582 | 585 | preserved_flat_dict_list = copy.deepcopy(flat_rows_list) # Use this later for assert comparison | 583 | 586 |
| @@ -1405,13 +1408,13 @@ def test_list_ignore_order_various_deltas2(self): | 1405 | 1408 |
| 1406 | 1409 | flat_result1 = delta1.to_flat_rows() | 1407 | 1410 | flat_expected1 = [ | 1408 | | - {'path': [0], 'value': 7, 'action': 'unordered_iterable_item_added'}, | 1409 | | - {'path': [6], 'value': 8, 'action': 'unordered_iterable_item_added'}, | 1410 | | - {'path': [1], 'value': 4, 'action': 'unordered_iterable_item_added'}, | 1411 | | - {'path': [2], 'value': 4, 'action': 'unordered_iterable_item_added'}, | 1412 | | - {'path': [5], 'value': 4, 'action': 'unordered_iterable_item_added'}, | 1413 | | - {'path': [6], 'value': 6, 'action': 'unordered_iterable_item_removed'}, | 1414 | | - {'path': [0], 'value': 5, 'action': 'unordered_iterable_item_removed'}, | | 1411 | + {'path': [0], 'value': 7, 'action': 'unordered_iterable_item_added', 'type': int}, | | 1412 | + {'path': [6], 'value': 8, 'action': 'unordered_iterable_item_added', 'type': int}, | | 1413 | + {'path': [1], 'value': 4, 'action': 'unordered_iterable_item_added', 'type': int}, | | 1414 | + {'path': [2], 'value': 4, 'action': 'unordered_iterable_item_added', 'type': int}, | | 1415 | + {'path': [5], 'value': 4, 'action': 'unordered_iterable_item_added', 'type': int}, | | 1416 | + {'path': [6], 'value': 6, 'action': 'unordered_iterable_item_removed', 'type': int}, | | 1417 | + {'path': [0], 'value': 5, 'action': 'unordered_iterable_item_removed', 'type': int}, | 1415 | 1418 | ] | 1416 | 1419 | flat_expected1 = [FlatDeltaRow(**i) for i in flat_expected1] | 1417 | 1420 | assert flat_expected1 == flat_result1 | @@ -1422,11 +1425,11 @@ def test_list_ignore_order_various_deltas2(self): | 1422 | 1425 |
| 1423 | 1426 | flat_result2 = delta2.to_flat_rows() | 1424 | 1427 | flat_expected2 = [ | 1425 | | - {'path': [1], 'value': 4, 'action': 'unordered_iterable_item_added'}, | 1426 | | - {'path': [2], 'value': 4, 'action': 'unordered_iterable_item_added'}, | 1427 | | - {'path': [5], 'value': 4, 'action': 'unordered_iterable_item_added'}, | 1428 | | - {'path': [6], 'action': 'values_changed', 'value': 7}, | 1429 | | - {'path': [0], 'action': 'values_changed', 'value': 8}, | | 1428 | + {'path': [1], 'value': 4, 'action': 'unordered_iterable_item_added', 'type': int}, | | 1429 | + {'path': [2], 'value': 4, 'action': 'unordered_iterable_item_added', 'type': int}, | | 1430 | + {'path': [5], 'value': 4, 'action': 'unordered_iterable_item_added', 'type': int}, | | 1431 | + {'path': [6], 'action': 'values_changed', 'value': 7, 'type': int}, | | 1432 | + {'path': [0], 'action': 'values_changed', 'value': 8, 'type': int}, | 1430 | 1433 | ] | 1431 | 1434 | flat_expected2 = [FlatDeltaRow(**i) for i in flat_expected2] | 1432 | 1435 | assert flat_expected2 == flat_result2 | @@ -1565,7 +1568,7 @@ def test_apply_delta_to_incompatible_object6_value_change(self): | 1565 | 1568 | assert [] == t4 | 1566 | 1569 |
| 1567 | 1570 | flat_result2 = delta2.to_flat_rows() | 1568 | | - flat_expected2 = [{'path': [1, 2, 0], 'action': 'values_changed', 'value': 5}] | | 1571 | + flat_expected2 = [{'path': [1, 2, 0], 'action': 'values_changed', 'value': 5, 'type': int}] | 1569 | 1572 | flat_expected2 = [FlatDeltaRow(**i) for i in flat_expected2] | 1570 | 1573 |
| 1571 | 1574 | assert flat_expected2 == flat_result2 | @@ -1575,7 +1578,7 @@ def test_apply_delta_to_incompatible_object6_value_change(self): | 1575 | 1578 |
| 1576 | 1579 | delta3 = Delta(diff, raise_errors=False, bidirectional=True) | 1577 | 1580 | flat_result3 = delta3.to_flat_rows() | 1578 | | - flat_expected3 = [{'path': [1, 2, 0], 'action': 'values_changed', 'value': 5, 'old_value': 4}] | | 1581 | + flat_expected3 = [{'path': [1, 2, 0], 'action': 'values_changed', 'value': 5, 'old_value': 4, 'type': int, 'old_type': int}] | 1579 | 1582 | flat_expected3 = [FlatDeltaRow(**i) for i in flat_expected3] | 1580 | 1583 |
| 1581 | 1584 | assert flat_expected3 == flat_result3 | @@ -1685,7 +1688,7 @@ def test_delta_to_dict(self): | 1685 | 1688 | assert expected == result | 1686 | 1689 |
| 1687 | 1690 | flat_result = delta.to_flat_rows() | 1688 | | - flat_expected = [{'action': 'unordered_iterable_item_removed', 'path': [2], 'value': 'B'}] | | 1691 | + flat_expected = [{'action': 'unordered_iterable_item_removed', 'path': [2], 'value': 'B', 'type': str}] | 1689 | 1692 | flat_expected = [FlatDeltaRow(**i) for i in flat_expected] | 1690 | 1693 |
| 1691 | 1694 | assert flat_expected == flat_result | @@ -1766,10 +1769,10 @@ def test_delta_set_in_objects(self): | 1766 | 1769 | delta = Delta(DeepDiff(t1, t2)) | 1767 | 1770 | flat_result = delta.to_flat_rows() | 1768 | 1771 | flat_expected = [ | 1769 | | - {'path': [0, 1], 'value': 10, 'action': 'set_item_added'}, | 1770 | | - {'path': [0, 0], 'action': 'values_changed', 'value': 2}, | 1771 | | - {'path': [0, 1], 'value': 'A', 'action': 'set_item_removed'}, | 1772 | | - {'path': [0, 1], 'value': 'C', 'action': 'set_item_added'}, | | 1772 | + {'path': [0, 1], 'value': 10, 'action': 'set_item_added', 'type': int}, | | 1773 | + {'path': [0, 0], 'action': 'values_changed', 'value': 2, 'type': int}, | | 1774 | + {'path': [0, 1], 'value': 'A', 'action': 'set_item_removed', 'type': str}, | | 1775 | + {'path': [0, 1], 'value': 'C', 'action': 'set_item_added', 'type': str}, | 1773 | 1776 | ] | 1774 | 1777 | flat_expected = [FlatDeltaRow(**i) for i in flat_expected] | 1775 | 1778 |
| @@ -1885,11 +1888,11 @@ def test_compare_func_with_duplicates_removed(self): | 1885 | 1888 |
| 1886 | 1889 | flat_result = delta.to_flat_rows() | 1887 | 1890 | flat_expected = [ | 1888 | | - {'path': [2], 'value': {'id': 1, 'val': 3}, 'action': 'iterable_item_removed'}, | 1889 | | - {'path': [0], 'value': {'id': 1, 'val': 3}, 'action': 'iterable_item_removed'}, | 1890 | | - {'path': [3], 'value': {'id': 3, 'val': 3}, 'action': 'iterable_item_removed'}, | 1891 | | - {'path': [0], 'action': 'iterable_item_moved', 'value': {'id': 1, 'val': 3}, 'new_path': [2]}, | 1892 | | - {'path': [3], 'action': 'iterable_item_moved', 'value': {'id': 3, 'val': 3}, 'new_path': [0]}, | | 1891 | + {'path': [2], 'value': {'id': 1, 'val': 3}, 'action': 'iterable_item_removed', 'type': dict}, | | 1892 | + {'path': [0], 'value': {'id': 1, 'val': 3}, 'action': 'iterable_item_removed', 'type': dict}, | | 1893 | + {'path': [3], 'value': {'id': 3, 'val': 3}, 'action': 'iterable_item_removed', 'type': dict}, | | 1894 | + {'path': [0], 'action': 'iterable_item_moved', 'value': {'id': 1, 'val': 3}, 'new_path': [2], 'type': dict}, | | 1895 | + {'path': [3], 'action': 'iterable_item_moved', 'value': {'id': 3, 'val': 3}, 'new_path': [0], 'type': dict}, | 1893 | 1896 | ] | 1894 | 1897 | flat_expected = [FlatDeltaRow(**i) for i in flat_expected] | 1895 | 1898 |
| @@ -2289,11 +2292,13 @@ def test_subtract_delta_made_from_flat_dicts1(self): | 2289 | 2292 | expected_flat_dicts = [{ | 2290 | 2293 | 'path': ['field_name1', 0], | 2291 | 2294 | 'value': 'xxx', | 2292 | | - 'action': 'iterable_item_removed' | | 2295 | + 'action': 'iterable_item_removed', | | 2296 | + 'type': str, | 2293 | 2297 | }, { | 2294 | 2298 | 'path': ['field_name1', 1], | 2295 | 2299 | 'value': 'yyy', | 2296 | | - 'action': 'iterable_item_removed' | | 2300 | + 'action': 'iterable_item_removed', | | 2301 | + 'type': str, | 2297 | 2302 | }] | 2298 | 2303 | expected_flat_dicts = [FlatDeltaRow(**i) for i in expected_flat_dicts] | 2299 | 2304 |
| @@ -2318,11 +2323,13 @@ def test_subtract_delta_made_from_flat_dicts2(self): | 2318 | 2323 | expected_flat_dicts = [{ | 2319 | 2324 | 'path': ['field_name1', 0], | 2320 | 2325 | 'value': 'xxx', | 2321 | | - 'action': 'iterable_item_added' | | 2326 | + 'action': 'iterable_item_added', | | 2327 | + 'type': str, | 2322 | 2328 | }, { | 2323 | 2329 | 'path': ['field_name1', 1], | 2324 | 2330 | 'value': 'yyy', | 2325 | | - 'action': 'iterable_item_added' | | 2331 | + 'action': 'iterable_item_added', | | 2332 | + 'type': str, | 2326 | 2333 | }] | 2327 | 2334 | expected_flat_dicts = [FlatDeltaRow(**i) for i in expected_flat_dicts] | 2328 | 2335 |
| |
|