mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Handle DedupedColumnCollection in db_indexes
This should fix the `scripts/check_model.py` script and the database indexes github workflow. Accessing index columns has changed: index.columns gives access to a DedupedColumnCollection instead of a ColumnCollection. Columns can be accessed by key; keys are accessed via keys() attr. Ref: https://docs.sqlalchemy.org/en/14/changelog/migration_14.html#select-objects-and-derived-from-clauses-allow-for-duplicate-columns-and-column-labels https://docs.sqlalchemy.org/en/14/core/sqlelement.html?highlight=dedupecolumncollection#sqlalchemy.sql.expression.ColumnCollection
This commit is contained in:
@@ -19,7 +19,7 @@ IndexTuple = namedtuple('IndexTuple', 'table column_names')
|
||||
|
||||
|
||||
def tuple_from_index(index):
|
||||
columns = tuple([getattr(index.columns, c).name for c in dir(index.columns) if not c.startswith('__')])
|
||||
columns = tuple([index.columns[key].name for key in index.columns.keys()])
|
||||
if len(columns) == 1:
|
||||
columns = columns[0]
|
||||
return IndexTuple(index.table.name, columns)
|
||||
|
||||
Reference in New Issue
Block a user