Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New recursive diff #53715

Closed
wants to merge 9 commits into from
Closed

Conversation

github-abcde
Copy link
Contributor

What does this PR do?

It adds recursive_diff to salt.utils.data. This is a recursive diff that can handle mixed nested mappings/iterables. This is an alternative to salt/utils/dictdiffer.py or salt/utils/listdiffer.py that can only handle nested dicts and list-of-nested-dicts respectively.

What issues does this PR fix or reference?

None that I'm aware of.

Previous Behavior

Only nested dicts or list-of-nested-dicts could be recursively diffed. Nothing is available to recursively diff a mix of lists, dicts, OrderedDicts, sets, tuples or other mapping or iterable type.

New Behavior

salt.utils.data.recursive_diff is able to produce a dict with old and new keys for any combination of nested mapping- or iterable types. Some options are only applicable to certain types, like ignore_keys and ignore_missing_keys will only work on (nested) mappings, and ignore_order will only make a difference on ordered datatypes (like OrderedDict and list).

Tests written?

Yes

Commits signed with GPG?

Yes

@github-abcde github-abcde requested a review from a team as a code owner July 29, 2019 07:40
@ghost ghost requested a review from Akm0d July 29, 2019 07:40
@github-abcde
Copy link
Contributor Author

Closed in favor of #55759.

@github-abcde github-abcde deleted the new_recursive_diff branch January 6, 2020 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants