You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
(Colored) View: Do not show unchanged keys in changed dictionaries #568
Is your feature request related to a problem? Please describe.
I have 2 huge root dictionaries (40k keys) and want to run a single comparison on them.
Only a couple of keys commonly differ. I want to generate a colored output (or other formats such as .md or html in future) only for the changed keys.
If I generate the view for the root dictionaries, I get a huge lot of unchanged keys reported that users are not interested in:
Can I exclude unchanged root keys already now? If not, is there a mechanism for custom views / report types?
Describe the solution you'd like
For dictionary comparisons, generate views that exclude unchanged root keys from the report/view.
Describe alternatives you've considered
Run the comparison multiple times, first for the root dictionaries to find changed keys, then individual diffs on those. That's a performance nightmare.
Post-process the colored output to textually filter the unchanged keys. That's bad engineering.
A new option to generate a view from a given diff result for a specific path in the result, that I can call for all changed root keys.
Build a custom report from a tree view on my side. Can do that, but would benefit from some guidance / best effort method.
Activity
ubmarco commentedon Sep 16, 2025
Ok, I went and copied https://github.com/seperman/deepdiff/blob/master/deepdiff/colored_view.py to my project.
From there I modified it with a new flag
hide_unchanged_root_keysthat is used in_colorize_json:Works for me, but the detection of whether I am on the root feels ugly.
Arshadwaqas115 commentedon Nov 25, 2025
Facing the same issue,
jgunstone commentedon Nov 26, 2025
yes - working with @Arshadwaqas115 and would love to see an "Ultra Compact" view that shows changes only
e.g. working from you example:
https://zepworks.com/deepdiff/current/colored_view.html#colored-compact-view
Current Compact View
Proposed Ultra-Compact View