Re: [sqlalchemy] Decimals generated as strings in query

2017-07-28 Thread Samer Atiani
Makes sense. I modified my code to look like this for cross DB compatibility - which I believe is identical to the workaround you mention in issue #3891 - I'm pasting it here for others who may face the same problem: class _cast_on_mysql(ColumnElement): def __init__(self, bindvalue, *args,

Re: [sqlalchemy] Decimals generated as strings in query

2017-07-28 Thread Mike Bayer
On Fri, Jul 28, 2017 at 1:46 PM, Samer Atiani wrote: > The way I'm handling this is by creating a TypeDecorator with the following > function: > > > def bind_expression(self, value): > """ > The objective of this is to force MySQL to deal with bind >

[sqlalchemy] Re: Streamlined dictionary numpy arrays storage in a one-to-many relationship

2017-07-28 Thread Jonathan Vanasco
Unless you need to use all the readings immediately, have you considered just making a custom def under the Sensor model, and then inserting all the readings via sqlalchemy core? That would allow you to insert them without creating ORM objects, which people using numpy and a lot of data often

Re: [sqlalchemy] Decimals generated as strings in query

2017-07-28 Thread Samer Atiani
The way I'm handling this is by creating a TypeDecorator with the following function: def bind_expression(self, value): """ The objective of this is to force MySQL to deal with bind parameters as decimals rather than as strings. MySQL for some insane reason