Fix SA2.0 error: list arg to select; mypy

This commit is contained in:
John Davis
2024-04-02 10:08:53 -04:00
parent 3c74f9d037
commit 631b5049a6
+2 -1
View File
@@ -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):