[Sqlalchemy-tickets] Issue #3180: don't fall over for dialects that have discrepancies in table col
Brought to you by:
zzzeek
|
From: Mike B. <iss...@bi...> - 2014-09-02 16:11:59
|
New issue 3180: don't fall over for dialects that have discrepancies in table cols vs. index cols reported https://bitbucket.org/zzzeek/sqlalchemy/issue/3180/dont-fall-over-for-dialects-that-have Mike Bayer: this is happening on oracle but we can just guard against this more fundamentally: ``` #!python from sqlalchemy import create_engine, Table, MetaData, Integer import mock e = create_engine("sqlite://") e.execute("""create table x (a integer, b integer)""") e.execute("""create index x_i on x(a, b)""") def mock_get_columns(self, connection, table_name, **kw): return [ {"name": "b", "type": Integer, "primary_key": False} ] with mock.patch.object(e.dialect, "get_columns", mock_get_columns): m = MetaData() t = Table('x', m, autoload_with=e) ``` |