dyff icon indicating copy to clipboard operation
dyff copied to clipboard

Duplicate keys in map lead to dyff finding a diff even if there's not

Open AlanLonguet opened this issue 1 year ago • 0 comments

Hey !

Context

We're using dyff to check the difference between 2 rendered Helm template. With Helm you can end up with duplicate keys in a map if for some reason you set some default value in a map that can later be overriden through user input, those duplicate keys lead to dyff finding a diff where there should be none.

Issue

Rendered Helm file

# test.yaml
test:
  element1: test
  element1: test2

Dyff command

dyff between test.yaml test.yaml

Dyff result

     _        __  __
   _| |_   _ / _|/ _|  between test.yaml
 / _' | | | | |_| |_       and test.yaml
| (_| | |_| |  _|  _|
 \__,_|\__, |_| |_|   returned one difference
        |___/

test.element1
  ± value change
    - test2
    + test

AlanLonguet avatar Mar 21 '24 15:03 AlanLonguet