diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 19668e985fd..6054b575575 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -7649,6 +7649,7 @@ class StoredWorkflow(Base, HasTags, Dictifiable, RepresentById): def invocation_counts(self) -> InvocationsStateCounts: sa_session = object_session(self) + assert sa_session stmt = ( select(WorkflowInvocation.state, func.count(WorkflowInvocation.state)) .select_from(StoredWorkflow) @@ -7658,7 +7659,7 @@ class StoredWorkflow(Base, HasTags, Dictifiable, RepresentById): .where(StoredWorkflow.id == self.id) ) rows = sa_session.execute(stmt).all() - rows_as_dict = dict(r for r in rows if r[0] is not None) + rows_as_dict = dict(r for r in rows if r[0] is not None) # type:ignore[arg-type, var-annotated] return InvocationsStateCounts(rows_as_dict) def to_dict(self, view="collection", value_mapper=None):