Unable to assign decimal values to 'number' type attributes

Bug #1430775 reported by Vivek Dhayaal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MagnetoDB
New
Undecided
Unassigned

Bug Description

Data model @ http://magnetodb.readthedocs.org/en/latest/user_guide.html
states about the 'Number' data type as "Numbers are positive or negative exact-value decimals and integers. "
But when we try to assign a decimal value to an attribute of 'Number' data type, the below exception is thrown:

<snip>
>>> c.put_item('trust', {'expected': {...}, 'item': {..., 'count': {'N': 4.0}, ...}})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/magnetodbclient/v1/client.py", line 92, in put_item
    return self.post(self.put_item_path % table_name, request_body)
  File "/usr/local/lib/python2.7/dist-packages/magnetodbclient/v1/client_base.py", line 195, in post
    headers=headers, params=params)
  File "/usr/local/lib/python2.7/dist-packages/magnetodbclient/v1/client_base.py", line 123, in do_request
    resp, replybody = self.httpclient.do_request(action, method, body=body)
  File "/usr/local/lib/python2.7/dist-packages/magnetodbclient/client.py", line 259, in do_request
    **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/magnetodbclient/client.py", line 221, in _cs_request
    resp, body = self._time_request(url, method, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/magnetodbclient/client.py", line 207, in _time_request
    resp, body = self.request(url, method, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/magnetodbclient/client.py", line 201, in request
    raise exceptions.from_response(resp, body, url)
magnetodbclient.common.exceptions.BadRequest: Can't recognize attribute value '4.0'of type {"type": "N"}
>>>
</snip>

Works fine when we assign an integer though.
<snip2>
>>> c.put_item('trust', {'expected': {...}, 'item': {..., 'count': {'N': 4}, ...}})
{}
>>>
</snip2>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.