Discussion:
[boto-users] dynamodb item uses Decimal but shouldn't
Henning Sprang
2015-08-06 10:39:13 UTC
Permalink
Hi,

I'm interpreting these parts of the docs:

http://boto.readthedocs.org/en/latest/ref/dynamodb.html?highlight=decimal#boto.dynamodb.layer2.Layer2.use_decimals
http://boto.readthedocs.org/en/latest/dynamodb_tut.html?highlight=decimal#working-with-decimals

in a way that I should get items from the database that use int or float.

But when doing this (*without* activating the decimal handling documented
results = list(table.scan())
results[0]['temperature']
Decimal('17')

I still seem to have the Decimal type for numbers.

Am I misinterpreting the docs?
Is there a switch to change that?

I want to do that because I'm feeding the data into bottle.py and it's
dumping the string with python's standard json.dumps, which in turn refuses
to work properly with the Decimal type
(https://bugs.python.org/issue16535), and I'd like to prevent manually
fixing each item before dumping it.

Thanks and cheers,
Henning
--
You received this message because you are subscribed to the Google Groups "boto-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to boto-users+***@googlegroups.com.
To post to this group, send email to boto-***@googlegroups.com.
Visit this group at http://groups.google.com/group/boto-users.
For more options, visit https://groups.google.com/d/optout.
Loading...