multi-primary key message in query._get() is busted

Issue #1458 resolved
Paul Harrington created an issue

change is obvious from the diff. If one has a table with a multi-column primary key and you attempt to do a session.get(i) (i.e. pass in a scalar) or session.get((i,)) (i.e. pass in a tuple of the wrong length), the exception fails with an AttributeError (our session is instantiated with query_cls=CachingQuery but a similar error occurs in the distributed sqlalchemy)

"query.get(); primary key columns are %s" % ', '.join("'%s'" % c for c in q.mapper.primary_key)) AttributeError: 'CachingQuery' object has no attribute 'mapper'

Comments (6)

  1. Paul Harrington reporter

    unit-tests for the mpck get (not sure if these work as I not yet get nosetests up and running on top of the SA development tree)

  2. Log in to comment