I've run into an issue with tables containing the special "-infinity" value 
in postgres. More precisely, when resolving relations on such tables.

SQLAlchemy will convert the value "-infinity" into "datetime(1, 1, 1, 0 , 
0)" and try to find rows in the related table with that value. This will 
obviously not match and return no rows. Using a "joinedload" on such 
relations will work, but then the backreference will have the same issue.

I've created a small runnable example 
here: https://gist.github.com/exhuma/3e7d0c7d176b41b208af684e55bcf020

It should be self explanatory.

I have not tested this with positive "infinity" but I assume it will be 
converted into "datetime.datetime.max" and thus fall victim to the same 
issue.

Any ideas for a workaround which does not involve modifying the values in 
the DB?

-- 
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 sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to