Skip to content

Commit

Permalink
Merge pull request #112 from networktocode/add_sorting
Browse files Browse the repository at this point in the history
Add ordering after data normalization.
  • Loading branch information
pszulczewski authored Jan 24, 2024
2 parents c3761d9 + d332aee commit 821760d
Show file tree
Hide file tree
Showing 5 changed files with 217 additions and 229 deletions.
4 changes: 3 additions & 1 deletion jdiff/extract_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def extract_data_from_json(data: Union[Mapping, List], path: str = "*", exclude:
else:
raise ValueError("Reference Key normalization failure. Please verify data type returned.")

return keys_values_zipper(list_of_reference_keys, paired_key_value)
normalized = keys_values_zipper(list_of_reference_keys, paired_key_value)
# Data between pre and post may come in different order, so it needs to be sorted.
return sorted(normalized, key=lambda arg: list(arg.keys()))

return values
Loading

0 comments on commit 821760d

Please sign in to comment.