You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 20, 2018. It is now read-only.
The current implementation of ranged queries does not work correctly in some cases due to the way redis-py handles floats.
The implementations of lt, gt, etc. in SortedSet, all call redis-py's zrangebyscore with a float as one of the arguments (_min_score or _max_score). redis-py calls convert on these to convert them to strings, using str(), which results in a loss of float precision. This means, that ranged queries like FooModel.objects.zfilter(some_attr__lt=10.009) return wrong results. I'd suggest converting float arguments to a string using "%f" % value before passing them to a redis-py query.
The text was updated successfully, but these errors were encountered:
The current implementation of ranged queries does not work correctly in some cases due to the way redis-py handles floats.
The implementations of
lt
,gt
, etc. in SortedSet, all call redis-py'szrangebyscore
with a float as one of the arguments (_min_score
or_max_score
). redis-py callsconvert
on these to convert them to strings, usingstr()
, which results in a loss of float precision. This means, that ranged queries likeFooModel.objects.zfilter(some_attr__lt=10.009)
return wrong results. I'd suggest converting float arguments to a string using"%f" % value
before passing them to a redis-py query.The text was updated successfully, but these errors were encountered: