[Cubicweb] A small feedback for the float format in rql

Jinpeng Li mr.li.jinpeng at gmail.com
Tue Apr 1 10:11:57 CEST 2014


Hi list,

I have a small feedback when I use float. It seems there is a bug in rql
parser for the exponent part of float.

>>> rql = "ScoreValue X where  X definition 6911 ,  X value 1.3e-05"
>>> session.execute(rql)
RQLSyntaxError: ScoreValue X where  X definition 6911 ,  X value 1.3e-05;
at: ('<f.1142>', 1, 52)
>>> rql = "ScoreValue X where  X definition 6911 ,  X value '1.3e-05'"
>>> session.execute(rql)
<resultset "ScoreValue X where  X definition 6911 ,  X value '1.3e-05'" (1
rows): [14295] (('ScoreValue',))>
>>> rql = "ScoreValue X where  X definition 6911 ,  X value 1.3"
>>> session.execute(rql)
<empty resultset for 'ScoreValue X where  X definition 6911 ,  X value 1.3'>

Definition in schema:

class ScoreValue(EntityType):

""" A score value """

definition = SubjectRelation('ScoreDefinition', cardinality='1*',
inlined=True, composite='object')

text = String(maxsize=2048, indexed=True)

value = Float(indexed=True)

datetime = Date()

Best,
Jinpeng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubicweb.org/pipermail/cubicweb/attachments/20140401/65a20bbb/attachment-0185.html>


More information about the Cubicweb mailing list