Skip to content

Commit eb9dd54

Browse files
committed
fix(server): annotate the binding page rows for SQLAlchemy 2.1
SQLAlchemy 2.1.0 no longer lets mypy infer the element type through `result.scalars().all()`, so CI fails typecheck with var-annotated on a line that is unchanged. The locked 2.0.51 still infers it, which is why this only appears in CI. Annotate the local explicitly; it holds under both versions.
1 parent 7a248ab commit eb9dd54

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎server/src/agent_control_server/services/control_bindings.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def _apply_filters(stmt): # type: ignore[no-untyped-def]
279279
if cursor is not None:
280280
page_stmt = page_stmt.where(ControlBinding.id < cursor)
281281
result = await self._db.execute(page_stmt.limit(limit + 1))
282-
rows = list(result.scalars().all())
282+
rows: list[ControlBinding] = list(result.scalars().all())
283283
has_more = len(rows) > limit
284284
if has_more:
285285
rows = rows[:limit]

0 commit comments

Comments
 (0)