don't fall over for dialects that have discrepancies in table cols vs. index cols reported
Issue #3180
resolved
this is happening on oracle but we can just guard against this more fundamentally:
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)
Comments (5)
-
reporter -
reporter - changed status to resolved
- An adjustment to table/index reflection such that if an index
reports a column that isn't found to be present in the table,
a warning is emitted and the column is skipped. This can occur
for some special system column situations as has been observed
with Oracle. fixes
#3180
→ <<cset ec840a6eea05>>
-
reporter - An adjustment to table/index reflection such that if an index
reports a column that isn't found to be present in the table,
a warning is emitted and the column is skipped. This can occur
for some special system column situations as has been observed
with Oracle. fixes
#3180
→ <<cset 34c0aaeedaf9>>
- An adjustment to table/index reflection such that if an index
reports a column that isn't found to be present in the table,
a warning is emitted and the column is skipped. This can occur
for some special system column situations as has been observed
with Oracle. fixes
-
Thanks, that looks great, should make it much easier for oracle / mssql users. It'll be a part of 0.9.8 update, right?
-
reporter yeah this is on for 0.9
- Log in to comment
we should raise a warning and skip the col for the index