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

ValidataclassMixin.to_dict: Optionally filter None values #39

Open
binaryDiv opened this issue Mar 2, 2022 · 0 comments
Open

ValidataclassMixin.to_dict: Optionally filter None values #39

binaryDiv opened this issue Mar 2, 2022 · 0 comments
Labels
breaking changes This issue will cause a breaking change (or deprecation warning). enhancement Improvements to existing features or smaller new features question Further information is requested
Milestone

Comments

@binaryDiv
Copy link
Contributor

binaryDiv commented Mar 2, 2022

Currently the to_dict() method of the ValidataclassMixin has no option to automatically filter None values, only for filtering UnsetValue (which it does by default but can be disabled by setting keep_unset_values=True).

There should be an option to filter None values (default: don't filter). The parameter could be called filter_none.

For consistency, the keep_unset_values parameter MAYBE should be renamed to filter_unset_value (default: True) as well, but this would be a breaking change in the API, so the existing parameter should be kept as an alias (with a deprecation warning) and later removed in the 1.0.0 release.

(This will potentially be included in #62.)

@binaryDiv binaryDiv added the enhancement Improvements to existing features or smaller new features label Mar 2, 2022
@binaryDiv binaryDiv added this to the 1.0.0 Release milestone Mar 2, 2022
@binaryDiv binaryDiv added the breaking changes This issue will cause a breaking change (or deprecation warning). label Mar 2, 2022
@binaryDiv binaryDiv added the question Further information is requested label Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking changes This issue will cause a breaking change (or deprecation warning). enhancement Improvements to existing features or smaller new features question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant