Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions gendiff/comparator.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
# * Fixed WPS441, WPS440 to allow variable names to be reused in multiple loops
# * https://github.com/wemake-services/wemake-python-styleguide/pull/1768#pullrequestreview-550906165 # noqa:E501
def compile_diff(first_data_set, second_data_set):
diff = {}
keys_intersection = first_data_set.keys() & second_data_set.keys()
for data_key in keys_intersection:
diff[data_key] = compare_same_keys(
diff = {data_key: compare_same_keys(
first_data_set.get(data_key), second_data_set.get(data_key),
)
) for data_key in keys_intersection}
Comment on lines -18 to +21
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function compile_diff refactored with the following changes:

keys_removed = first_data_set.keys() - second_data_set.keys()
for data_key in keys_removed: # noqa:WPS440
diff[data_key] = {STATUS: REMOVED, VALUE: first_data_set.get(data_key)} # noqa:WPS441, E501
Expand Down