-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
Fix bug in prune_dict where empty dict and list would be removed even in strict mode #32573
Conversation
Interesting, I wonder if those failing Lambda tests were written wrong or if these two functions are somehow not actually functionally identical. |
Yeah same, I'll take a look |
turns out they are not equivalent because of airflow/airflow/utils/helpers.py Lines 352 to 353 in 44b4a37
Which removes empty lists and dictionaries even if mode=strict , despite the doc saying it'll only remove None values in that case :/
|
I think we have 2 options,
|
why_not_both.gif I'd say the code should be fixed to match the docs in that case, but also I get that that isn't what you signed up for here so.... I guess drop this for now and maybe create an Issue pointing out the discrepancy in prune_dict()? |
You can fix the core helper function. |
@eladkal you requested changes earlier, I believe they were addressed, can you re-review ? |
Strict mode is supposed to remove only
None
values, but this was not applied to lists and dict.also prepare deprecation for the provider-specific method in amazon package doing the same thing.
As explained in code comments, we cannot replace it right now because of the bug fixed here, making behavior different.