mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Fix SA2.0 error: list arg to select; mypy
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user