Skip to content

deep_copy_list working incorrectly #403

@md2k

Description

@md2k

Describe the Bug

Option deep_copy_list working incorrectly with utils_deep_merge_yaml (not checked utils_deep_merge_json , but probably same).

deep merge configured with : append_list = false , deep_copy_list = true
Input of 2 yaml:

---
test:
  my_list:
     - item1
     - item2
---
test:
  my_list:
     - item1
     - item3
     - item4

Getting as result:

---
test:
  my_list:
     - item1
     - item2

so 2nd Yaml list ignored.
In version 1.23 if append_list and deep_copy_list both enabled, result as above, in versions below 1.23 result will be as expected, but probably because append_list in actions.

Expected Behavior

---
test:
  my_list:
     - item1
     - item2
     - item3
     - item4

Steps to Reproduce

Merge any yaml (even from example) with utils_deep_merge_yaml and deep_copy_list enabled

Screenshots

No response

Environment

OS [Mac M3, Mac Intel, Linux], module version 1.23, 1.22, 1.21, 1.20, 1.19, 1.18

Additional Context

Need to merge complex yaml files, with lists in them, in multiple cases it is required to have merge of lists and ensure we not have duplicates in final outputs, so for that we trying to use deep_copy_list , but seems doesn't work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug🐛 An issue with the system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions