Skip to content

Commit

Permalink
Merge pull request galaxyproject#16880 from mvdbeek/fix_nested_collec…
Browse files Browse the repository at this point in the history
…tion_query

[23.1] Fix join condition for nested collection query
  • Loading branch information
bgruening authored Oct 18, 2023
2 parents cdbbbbe + e617099 commit e4c4677
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6146,9 +6146,9 @@ def attribute_columns(column_collection, attributes, nesting_level=None):
inner_dc = alias(DatasetCollection)
inner_dce = alias(DatasetCollectionElement)
order_by_columns.append(inner_dce.c.element_index)
q = q.join(inner_dc, inner_dc.c.id == dce.c.child_collection_id).outerjoin(
inner_dce, inner_dce.c.dataset_collection_id == inner_dc.c.id
)
q = q.join(
inner_dc, and_(inner_dc.c.id == dce.c.child_collection_id, dce.c.dataset_collection_id == dc.c.id)
).outerjoin(inner_dce, inner_dce.c.dataset_collection_id == inner_dc.c.id)
q = q.add_columns(
*attribute_columns(inner_dce.c, element_attributes, nesting_level),
*attribute_columns(inner_dc.c, collection_attributes, nesting_level),
Expand Down

0 comments on commit e4c4677

Please sign in to comment.