Skip to content

Commit

Permalink
sqlalchemy 2.x: use attrs not strings for joining
Browse files Browse the repository at this point in the history
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 <tmadore@redhat.com>
Signed-off-by: Ben Alkov <ben.alkov@redhat.com>
  • Loading branch information
taylormadore authored and ben-alkov committed Dec 13, 2023
1 parent a7cd48e commit 0570c12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cachito/web/api_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
)

Expand Down

0 comments on commit 0570c12

Please sign in to comment.