From b11bfd5b0c7262bd207bbaf6be2d1b025119abe7 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 26 Jan 2016 17:28:40 -0500 Subject: [PATCH] - unfortunately we need to match within join where col.key does not match what's given so we need to use a set() here. contains_column is not within any performance paths (cherry picked from commit 5742e321b261c0c1303835b80418cd3cdc1b5643) --- lib/sqlalchemy/sql/base.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/sqlalchemy/sql/base.py b/lib/sqlalchemy/sql/base.py index 48b9a8a2b0..97fb04dd92 100644 --- a/lib/sqlalchemy/sql/base.py +++ b/lib/sqlalchemy/sql/base.py @@ -579,8 +579,7 @@ class ColumnCollection(util.OrderedProperties): object.__setattr__(self, '_all_columns', state['_all_columns']) def contains_column(self, col): - existing = self._data.get(col.key) - return existing is not None and hash(existing) == hash(col) + return col in set(self._all_columns) def as_immutable(self): return ImmutableColumnCollection(self._data, self._all_columns) -- 2.47.3