summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/schema.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-12-23 22:59:44 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2015-12-23 22:59:44 -0500
commitc7d6c667b53d96a65e0dedcb83c098e03d4c7453 (patch)
tree7ca6a760327812581139995de29f93e4af26a334 /lib/sqlalchemy/sql/schema.py
parent93b48e6aba6b1c20f525a0a22d58fc57ee4637f5 (diff)
downloadsqlalchemy-c7d6c667b53d96a65e0dedcb83c098e03d4c7453.tar.gz
- Fixed an assertion that would raise somewhat inappropriately
if a :class:`.Index` were associated with a :class:`.Column` that is associated with a lower-case-t :class:`.TableClause`; the association should be ignored for the purposes of associating the index with a :class:`.Table`. fixes #3616
Diffstat (limited to 'lib/sqlalchemy/sql/schema.py')
-rw-r--r--lib/sqlalchemy/sql/schema.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py
index 42dbe72b2..b244d746c 100644
--- a/lib/sqlalchemy/sql/schema.py
+++ b/lib/sqlalchemy/sql/schema.py
@@ -2498,9 +2498,13 @@ class ColumnCollectionMixin(object):
has_string_cols = set(self._pending_colargs).difference(col_objs)
if not has_string_cols:
def _col_attached(column, table):
- cols_wo_table.discard(column)
- if not cols_wo_table:
- self._check_attach(evt=True)
+ # this isinstance() corresponds with the
+ # isinstance() above; only want to count Table-bound
+ # columns
+ if isinstance(table, Table):
+ cols_wo_table.discard(column)
+ if not cols_wo_table:
+ self._check_attach(evt=True)
self._cols_wo_table = cols_wo_table
for col in cols_wo_table:
col._on_table_attach(_col_attached)