Skip to content

get rid of None values in prepareData @collective.solr/src/collective/solr/utils.py #276

@zmijunkie

Description

@zmijunkie

Hi - I just made prepareData(data) on my computer leave like this:

# get rid of None values
filtered = {k: v for k, v in data.items() if v is not None}
data.clear()
data.update(filtered)

Does this make sense for anybody else ? My usecase is: I have a plentyful of
attibutes and want to store only these with are not None. Also I found it weird to
store Strings in Solr with a value of "None" but YUMV ?

thx for your input,
Sascha

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions