diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2018-11-03 16:17:04 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@bbpush.zzzcomputing.com> | 2018-11-03 16:17:04 +0000 |
| commit | 4811e35fa31392a19e52412f2c4e4550c8620461 (patch) | |
| tree | 186417c671f63eddb7e6d1a858135a7fe5e7f624 /lib/sqlalchemy | |
| parent | 664290ab54b654e13a116ed4534e77663267a0e7 (diff) | |
| parent | 88bfa1b89c5b3b2290fa266c53322f003833af40 (diff) | |
| download | sqlalchemy-4811e35fa31392a19e52412f2c4e4550c8620461.tar.gz | |
Merge "Deannotate ORM columns in ColumnEntity"
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/orm/query.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index bfddb5cfe..cace2e54a 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -4243,6 +4243,11 @@ class _ColumnEntity(_QueryEntity): else: column = query._adapt_clause(self.column, False, True) + if column._annotations: + # annotated columns perform more slowly in compiler and + # result due to the __eq__() method, so use deannotated + column = column._deannotate() + if context.adapter: column = context.adapter.columns[column] @@ -4251,6 +4256,12 @@ class _ColumnEntity(_QueryEntity): def setup_context(self, query, context): column = query._adapt_clause(self.column, False, True) + + if column._annotations: + # annotated columns perform more slowly in compiler and + # result due to the __eq__() method, so use deannotated + column = column._deannotate() + context.froms += tuple(self.froms) context.primary_columns.append(column) |
