On Wed, Nov 1, 2017 at 12:47 AM, Jason Gosnell <jason.gosn...@gmail.com> wrote:
> Hi folks,
>
> Is the GlobalFilter recipe expected to still work with newer versions of
> sqlalchemy? I've copied and pasted the code right out of the recipe and get
> this assertion:
>
> 2017-10-31 21:38:22,391 INFO sqlalchemy.engine.base.Engine SELECT parent.id
> AS parent_id, parent.timestamp AS parent_timestamp, child_1.id AS
> child_1_id, child_1.parent_id AS child_1_parent_id, child_1.timestamp AS
> child_1_timestamp
> FROM parent LEFT OUTER JOIN child AS child_1 ON parent.id =
> child_1.parent_id AND child_1.timestamp BETWEEN ? AND ?
> WHERE parent.timestamp BETWEEN ? AND ?
> 2017-10-31 21:38:22,391 INFO sqlalchemy.engine.base.Engine ('2009-10-16
> 12:00:00.000000', '2009-10-18 12:00:00.000000', '2009-10-16
> 12:00:00.000000', '2009-10-18 12:00:00.000000')
> 2017-10-31 21:38:22,392 INFO sqlalchemy.engine.base.Engine SELECT parent.id
> AS parent_id, parent.timestamp AS parent_timestamp
> FROM parent
> WHERE parent.timestamp BETWEEN ? AND ?
> 2017-10-31 21:38:22,392 INFO sqlalchemy.engine.base.Engine ('2009-10-16
> 12:00:00.000000', '2009-10-18 12:00:00.000000')
> 2017-10-31 21:38:22,393 INFO sqlalchemy.engine.base.Engine SELECT child.id
> AS child_id, child.parent_id AS child_parent_id, child.timestamp AS
> child_timestamp
> FROM child
> WHERE ? = child.parent_id AND child.timestamp BETWEEN ? AND ?
> 2017-10-31 21:38:22,393 INFO sqlalchemy.engine.base.Engine (2, None, None)
> Traceback (most recent call last):
>   File "globalfilter_original.py", line 114, in <module>
>     assert parents[0].temporal_children == [c5]
> AssertionError
>
> I backtracked to sqlalchemy 0.9.10 to confirmed it works as advertised, and
> then rolled forward to 1.0.0 to confirmed it fails.

unfortunately this recipe has been broken since 2015 and you'll need
to wait for 
https://bitbucket.org/zzzeek/sqlalchemy/issues/4128/common-mapperoption-recipes-broken-since
to be fixed, and additionally be on the 1.1 series.   I can provide
hacky workarounds to make the example really work but unless you have
a critical need for these, it's better to wait for the example here to
be fully working where it will also be added to the test suite so that
it never breaks again.




>
> I also observed that in 1.0.0+, TemporalOption.process_query is never
> called.
>
> Thanks,
> Jason
>
> --
> 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.

-- 
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