Michael, Thanks for the reply. I understand what you're saying and can go search for that. I wonder if you could take a look at my question about join order determinism in polymorphic queries?
Thanks, Amir On Thursday, July 11, 2013 11:09:50 AM UTC-7, Michael Bayer wrote: > > > On Jul 11, 2013, at 11:43 AM, Amir Elaguizy <aela...@gmail.com<javascript:>> > wrote: > > > If I do a query like this: > > > > return PcpPostModel.query.filter_by(id=post_id).options( > > FromCache("default") > > ) > > > > and then later I do another query like this: > > > > PcpPostModel.query.options(FromCache("default")).all() > > > > Any models that were returned by the first query are now of type: <class > 'dogpile.cache.api.CachedValue'> > > CachedValue is a tuple-based container that contains the actual result you > want to work with as well as the time that the value was placed in the > cache. Take a look at the contents of CachedValue. > > > > > So then when the second query runs it will except with: > > > > File > "/Users/aelaguiz/workspace/stufff/venv/lib/python2.7/copy_reg.py", line 70, > in _reduce_ex > > raise TypeError, "can't pickle %s objects" % base.__name__ > > TypeError: can't pickle function objects > > > > Any idea what I can do about this? > > something in your model class, or your mapping, or perhaps within some > SQLAlchemy construct in use, is a callable function that isn't picklable. > SQLAlchemy itself goes through a lot of trouble to not embed functions in > mapped instances, however in some cases it's difficult to avoid. You'd > need to provide full detail on your classes/mappings, most preferably a > fully contained, runnable example, in order to determine where this > callable is present. > > > -- 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 http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/groups/opt_out.