skip_missing is gone, how to skip None elements ?
See original GitHub issueI saw that v2.0.0b removed the skip_missing
option, claiming it skips the missing entries by default.
However in my case (using mongoengine’s Document) a field is never missing: it returns None
which is, strictly speaking, something…
I can see from the commit (https://github.com/marshmallow-code/marshmallow/commit/a3908d36967ac30764ceb66c52c99357425fbdec) that previous behavior of skipping empty values (like None or empty list/tuple) has been obliterated. Is there now a new way to do this ?
I’m thinking for now to overload the _serialize
method of each field to check for the empty value and return the missing
singleton in such a case… but this sound really cumbersome to me, there must be a better way !
Issue Analytics
- State:
- Created 8 years ago
- Comments:20 (8 by maintainers)
Top Results From Across the Web
How to skip missing data in Scrapy - Stack Overflow
Try this one: def parse(self, response): for item in response.xpath('//*[@class="hehe"]'): joke = item.xpath('.
Read more >Missing Values - Julia Documentation
As this example shows, the element type of such arrays is Union{Missing, ... In this situation, use the skipmissing function to skip missing...
Read more >Solved: How to skip missing value? - SAS Support Communities
Solved: Hi, I want to calculate the weighted average of some variable the code looks like this Proc sql; Create table want as...
Read more >Health checks — XClim Official Documentation
skip : Skip missing value detection. from_context : Look-up the missing ... xclim.core.missing.missing_any(da, freq, src_timestep=None, **indexer)[source].
Read more >Miscellaneous Functions · StatsBase.jl - JuliaStats
The first element of the tuple is a vector of values of the input and the second ... skipmissing::Symbol=:none : If :none (the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry for the delayed response on this.
How about using a post-dump method to remove any null values? Something like:
Howdy! Thanks @sloria for this. Though you will run into problems if you have dicts or anything not hashable. Luckily I just needed to filter Nones out so I could change it to
if value is not None