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

throw a TypeError when trying to merge a list with a mapping when `me… #67093

Open
wants to merge 1 commit into
base: 3007.x
Choose a base branch
from

Conversation

tomdoherty
Copy link

@tomdoherty tomdoherty commented Dec 11, 2024

throw a TypeError when trying to merge a list with a mapping when merge_lists=True

What does this PR do?

What issues does this PR fix or reference?

Fixes #67092

Previous Behavior

Silently drops values

New Behavior

Throws TypeError

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

No

Please review Salt's Contributing Guide for best practices, including the
PR Guidelines.

See GitHub's page on GPG signing for more information about signing commits with GPG.

@tomdoherty tomdoherty requested a review from a team as a code owner December 11, 2024 11:03
@tomdoherty tomdoherty force-pushed the tomdoherty-bail-out-before-overwrite branch from efc8d7c to 62a37f8 Compare December 11, 2024 11:09
@lkubb
Copy link
Contributor

lkubb commented Dec 12, 2024

I don't think this is the correct (default) behavior since this function intends to emulate dict.update. This also happens for nested dicts, where a non-dict value overwrites the whole nested dict. If you want to enforce the same structure for both dicts, I would consider adding a strict switch or a separate function that enforces this.

Note that this should target 3008 since it's either breaking compatibility (a lot) or, if going with strict, introducing new functionality.

@tomdoherty tomdoherty force-pushed the tomdoherty-bail-out-before-overwrite branch from 62a37f8 to 35b366a Compare December 13, 2024 12:14
@tomdoherty tomdoherty force-pushed the tomdoherty-bail-out-before-overwrite branch from 35b366a to 3acaf41 Compare December 13, 2024 12:55
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