Hi, I think i found a little bug in the implementation for array data type in the postgres module of storm. Obviously postgres needs an explicit type cast there when one tries to insert a list of null values in a typed array column
example:
given a table like:
create table bogus(
realvalues real[]
);
defining a storm class for it:
>>> class Bogus(Storm):
... realvalues List(type=Float())
bogus = Bogus()
if you now set the realvalues property to a list of None values
>>> bogus.realvalues = [None, None]
storm tries to execute an sql statement akin to
update set realvalues = array[Null, Null];
which results in an operational error since postgres can not
autodetect the type of null values and defaults each untyped
array to Text[]
A fix for this would be to (instead of the update statement above)
us:
update set realvalues = cast(array[Null, Null] as real[]);
Sadly i havent found a good way to do type casts using storm syntax
so the only fix i can offer would be to do it 'manually' and add a
translation table for StormVariable types to SQL datatyped that can be
used to produce type casts in the 'compile_list_variable' function.
If wished i can provide such.
- regards, andreas kopecky
signature.asc
Description: OpenPGP digital signature
-- storm mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/storm
