Skip to content

Commit

Permalink
Fix bug: if using alias on ORM entity, use __table__ as valid FromClause
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavcs committed Feb 9, 2024
1 parent e4cdabf commit 115d509
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6307,8 +6307,8 @@ def _build_nested_collection_attributes_stmt(
dataset_permission_attributes = dataset_permission_attributes or ()
return_entities = return_entities or ()
dataset_collection = self
dc = alias(DatasetCollection)
dce = alias(DatasetCollectionElement)
dc = alias(DatasetCollection.__table__)
dce = alias(DatasetCollectionElement.__table__)
depth_collection_type = dataset_collection.collection_type
order_by_columns = [dce.c.element_index]
nesting_level = 0
Expand All @@ -6329,8 +6329,8 @@ def attribute_columns(column_collection, attributes, nesting_level=None):

while ":" in depth_collection_type:
nesting_level += 1
inner_dc = alias(DatasetCollection)
inner_dce = alias(DatasetCollectionElement)
inner_dc = alias(DatasetCollection.__table__)
inner_dce = alias(DatasetCollectionElement.__table__)
order_by_columns.append(inner_dce.c.element_index)
q = q.join(
inner_dc, and_(inner_dc.c.id == dce.c.child_collection_id, dce.c.dataset_collection_id == dc.c.id)
Expand Down

0 comments on commit 115d509

Please sign in to comment.