the asdecimal=False would be the way to go here. The fact that its
returning 'int' is probably an artifact of the SQLite driver, perhaps
that the numerical values that are stored don't actually have a decimal
portion so it isn't known that these are "float" and not "int" (sqlite
has a per-row tying model). Normally it shouldn't be an issue that
these are ints because Python ints/floats can be used together, but if
you want to force float, use TypeDecorator
(
http://docs.sqlalchemy.org/en/rel_1_0/core/custom_types.html?highlight=typedecorator#augmenting-existing-types):
class ForceFloat(TypeDecorator):
impl = Numeric(10, 2, asdecimal=False)
def process_result_value(self, value, dialect):
if value is not None:
value = float(value)
return value