From 0570c125fc31b8b050ffd6e8833184aee56805b5 Mon Sep 17 00:00:00 2001 From: Taylor Madore Date: Tue, 21 Mar 2023 17:18:21 -0400 Subject: [PATCH] sqlalchemy 2.x: use attrs not strings for joining https://docs.sqlalchemy.org/en/20/changelog/migration_20.html#orm-query-joining-loading-on-relationships-uses-attributes-not-strings Signed-off-by: Taylor Madore Signed-off-by: Ben Alkov --- cachito/web/api_v1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cachito/web/api_v1.py b/cachito/web/api_v1.py index ad0a01eb1..3766252b1 100644 --- a/cachito/web/api_v1.py +++ b/cachito/web/api_v1.py @@ -780,7 +780,7 @@ def _get_valid_request_ids(all_request_ids: str) -> List[int]: def _get_all_requests(request_ids: List[int]) -> list[Request]: requests = ( Request.query.filter(Request.id.in_(request_ids)) - .options(load_only("id"), joinedload(Request.state)) + .options(load_only(Request.id), joinedload(Request.state)) # type: ignore[arg-type] .all() )