Skip to content

annotations bug #2660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sqlalchemy-bot opened this issue Feb 2, 2013 · 2 comments
Closed

annotations bug #2660

sqlalchemy-bot opened this issue Feb 2, 2013 · 2 comments
Labels
blocker issue that must be resolved asap as it is preventing things from working bug Something isn't working sql
Milestone

Comments

@sqlalchemy-bot
Copy link
Collaborator

Migrated issue, originally created by Michael Bayer (@zzzeek)

from sqlalchemy.sql import column

c = column('x')

c == 5

c1 = c._annotate({"x": True})
c1 == 5

c2 = c1._annotate({"y": True})

assert (c2 == 5).left._annotations == {"x": True, "y": True}

patch:

diff -r acb9ded7c87d30446c19c825aa8fd373827f1040 lib/sqlalchemy/sql/util.py
--- a/lib/sqlalchemy/sql/util.py	Sat Feb 02 18:59:19 2013 -0500
+++ b/lib/sqlalchemy/sql/util.py	Sat Feb 02 19:49:44 2013 -0500
@@ -449,7 +449,7 @@
     def _with_annotations(self, values):
         clone = self.__class__.__new__(self.__class__)
         clone.__dict__ = self.__dict__.copy()
-        expression.ColumnElement.comparator._reset(self)
+        expression.ColumnElement.comparator._reset(clone)
         clone._annotations = values
         return clone

this is related to a fix coming up for #1768

@sqlalchemy-bot
Copy link
Collaborator Author

Michael Bayer (@zzzeek) wrote:

af44efe

@sqlalchemy-bot
Copy link
Collaborator Author

Changes by Michael Bayer (@zzzeek):

  • changed status to closed

@sqlalchemy-bot sqlalchemy-bot added bug Something isn't working blocker issue that must be resolved asap as it is preventing things from working sql labels Nov 27, 2018
@sqlalchemy-bot sqlalchemy-bot added this to the 0.8.0final milestone Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker issue that must be resolved asap as it is preventing things from working bug Something isn't working sql
Projects
None yet
Development

No branches or pull requests

1 participant