redis-om-python icon indicating copy to clipboard operation
redis-om-python copied to clipboard

Missing support for boolean field or examples of how to do it

Open sriveros95 opened this issue 2 years ago • 4 comments

I have a model like MyModel(HashModel): local_auth: bool When initing or saving I get: DataError("Invalid input of type: 'bool'. Convert to a bytes, string, int or float first.")

sriveros95 avatar Apr 06 '22 20:04 sriveros95

Hi there - boolean fields aren't yet supported for JSON or Hash, they'll likely appear in JSON first as boolean is a native type there vs a Redis Hash that understands strings, floats and ints.

simonprickett avatar Apr 07 '22 11:04 simonprickett

I'm talking to the maintainers of the other Redis OM Clients for different languages to make sure that when we do add booleans to Python there's a common approach where possible.

simonprickett avatar Apr 13 '22 10:04 simonprickett

@simonprickett , any update on native support for boolean fields?

jrwagz avatar Jul 18 '23 01:07 jrwagz

@jrwagz I don't have an update here, copying in @dvora-h

simonprickett avatar Jul 21 '23 19:07 simonprickett