Skip to content

DSL: preserve the skip_empty setting in to_dict() recursive serializations #3041

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

pquentin
Copy link
Member

I wanted to fix elastic/elasticsearch-dsl-py#1577, but realized I wasn't able to reproduce it.

@miguelgrinberg
Copy link
Contributor

@pquentin added a 2nd commit with a small adjustment to your attempt that does reproduce the issue. The 3rd commit contains the fix, which involves the plumbing to pass skip_empty through recursive serializations.

@miguelgrinberg miguelgrinberg force-pushed the reproduce-issue-1577 branch 3 times, most recently from 477b784 to 6c4f43d Compare August 14, 2025 10:24
@miguelgrinberg miguelgrinberg changed the title Try reproducing DSL issue 1577 respect to_dict's skip_empty setting in recursive serializations Aug 14, 2025
@miguelgrinberg miguelgrinberg changed the title respect to_dict's skip_empty setting in recursive serializations DSL: preserve the skip_empty setting in to_dict() recursive serializations Aug 14, 2025
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.

to_dict(skip_empty=False) doesn't work recursively
2 participants