Avoid using .values() on the indexed columns
The length of a dict-like object should be the same as the length of the list of values in the object, so calling .values() should be unnecessary here. Change-Id: I625dc7dea00cc8f09c68ea104c5c64c5f39fffc0 Closes-Bug: 1297059
This commit is contained in:
parent
e8733b4e6a
commit
8a22fcd665
|
@ -77,7 +77,7 @@ def upgrade(migrate_engine):
|
|||
region_table = sql.Table(_REGION_TABLE_NAME, meta, autoload=True)
|
||||
for idx in region_table.indexes:
|
||||
if ((idx.columns.get('description') == region_table.c.description) and
|
||||
len(idx.columns.values()) is 1):
|
||||
len(idx.columns) is 1):
|
||||
# Constraint was found, do the migration.
|
||||
_migrate_to_new_region_table(meta, migrate_engine, region_table)
|
||||
break
|
||||
|
|
Loading…
Reference in New Issue