Skip to content

Commit

Permalink
Fix RemovedIn20Warning: retrieving row members using strings
Browse files Browse the repository at this point in the history
"RemovedIn20Warning: Retrieving row members using strings or other non-integers is deprecated"
  • Loading branch information
jdavcs committed Dec 5, 2023
1 parent 53121ca commit 74e70af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/galaxy/jobs/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ def get_user_job_count_per_destination(self, user_id):
)
.group_by(model.Job.table.c.destination_id)
)
for row in result:
for row in result.mapping():
# Add the count from the database to the cached count
rval[row["destination_id"]] = rval.get(row["destination_id"], 0) + row["job_count"]
return rval
Expand All @@ -897,7 +897,7 @@ def __cache_user_job_count_per_destination(self):
.where(and_(model.Job.table.c.state.in_((model.Job.states.QUEUED, model.Job.states.RUNNING))))
.group_by(model.Job.table.c.user_id, model.Job.table.c.destination_id)
)
for row in result:
for row in result.mappings():
if row["user_id"] not in self.user_job_count_per_destination:
self.user_job_count_per_destination[row["user_id"]] = {}
self.user_job_count_per_destination[row["user_id"]][row["destination_id"]] = row["job_count"]
Expand Down

0 comments on commit 74e70af

Please sign in to comment.