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

merge_update() not merging nested dictionaries or lists #253

Closed
191801737 opened this issue May 12, 2023 · 1 comment
Closed

merge_update() not merging nested dictionaries or lists #253

191801737 opened this issue May 12, 2023 · 1 comment
Labels

Comments

@191801737
Copy link

191801737 commented May 12, 2023

Does this make sense? I need it for myself, but maybe it's not box' responsibility.

(venv) > ipython
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
In [1]: import box

In [2]: box.__version__
Out[2]: '7.0.1'

In [3]: d1 = {'app': {'S3': {'S3Service': [{'bucket': 'bucket001'}]}}}

In [4]: d2 = {'app': {'S3': {'S3Service': [{'expirationDate': '2099-10-25'}]}}}

In [5]: box1 = box.Box(d1)

In [6]: box1.merge_update(d2, box_merge_lists='extend')

In [7]: box1
Out[7]: Box({'app': {'S3': {'S3Service': [{'expirationDate': '2099-10-25'}]}}})

I was expecting:

In [9]: box1
Out[9]: Box({'app': {'S3': {'S3Service': [{'bucket': "bucket001'"}, {'expirationDate': '2099-10-25'}]}}})

Can anyone help me?

@cdgriffith cdgriffith added the bug label Jun 15, 2023
cdgriffith added a commit that referenced this issue Jun 15, 2023
cdgriffith added a commit that referenced this issue Aug 26, 2023
* Adding #255 defer ipython import for large import speed improvements (thanks to Eric Prestat)
* Adding testing for Python 3.12
* Fixing #253 merge_update box list merge types not populated to sub dictionaries (thanks to lei wang)
* Fixing #257 Two test failures due to arguments having incorrect types (thanks to Michał Górny)
* Fixing stub files to match latest code signatures
* Removing #251 support for circular references in lists (thanks to d00m514y3r)

---------

Co-authored-by: Eric Prestat <eric.prestat@gmail.com>
@cdgriffith
Copy link
Owner

Thanks for bringing this up, fixed in 7.1.0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants