Am Freitag, 23. Juni 2017 05:25:41 UTC+2 schrieb Mike Bayer:
>
>
>
> return my_col * literal(0.5, Float()) 
>

Hello Mike,
 
thank you for the quick response.

This doesn't seem to fully work when querying the value using 
session.query(MyObject.my_hybrid_expression).scalar(). From the callstack, 
the Numeric (possibly representing the result of the multiplication) now 
seems to be initialized by type_api.py:to_instance, which calls the Numeric 
constructor without passing any **kwargs, so it again defaults to 
asdecimal=True. This method is called by 
sqltypes.py:_DateAffinity.Comparator._adapt_expression, which finds 
MyFloat._type_affinity == Numeric.

Greetings,
Phillip

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to