Skip to content

deferred() does not work with ShardedSession #771

Closed
@sqlalchemy-bot

Description

@sqlalchemy-bot
Collaborator

Migrated issue, originally created by Anonymous

If I declare a field as "deferred()", and use it within a ShardedSession, it blows up when trying to access the field.

I am pretty sure this is because the get_bind() method in ShardedSession does not accept a keyword parameter named "clause". But the superclass's method, Session.get_bind(), does take such a parameter.

This is easy to reproduce by taking examples/sharding/attribute_shard.py and applying the attached patch to it.

  • Terry Weissman terry at weissman.org trw in #sqlalchemy

Attachments: patch

Activity

sqlalchemy-bot

sqlalchemy-bot commented on Aug 30, 2007

@sqlalchemy-bot
CollaboratorAuthor

Anonymous wrote:

Patch to reproduce bug

sqlalchemy-bot

sqlalchemy-bot commented on Aug 30, 2007

@sqlalchemy-bot
CollaboratorAuthor

Changes by Anonymous:

  • attached file patch
sqlalchemy-bot

sqlalchemy-bot commented on Sep 8, 2007

@sqlalchemy-bot
CollaboratorAuthor

Michael Bayer (@zzzeek) wrote:

fc753a0 . take a look over there, I've also added an extra kwarg to shard_chooser "clause", which is the ClauseElement passed to session.execute(), for clients which use that feature. Otherwise it'll be None.

sqlalchemy-bot

sqlalchemy-bot commented on Sep 8, 2007

@sqlalchemy-bot
CollaboratorAuthor

Changes by Michael Bayer (@zzzeek):

  • changed status to closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @sqlalchemy-bot

        Issue actions

          deferred() does not work with ShardedSession · Issue #771 · sqlalchemy/sqlalchemy