Skip to content

Commit

Permalink
Fix RemovedIn20Warning: execute() parameters
Browse files Browse the repository at this point in the history
"RemovedIn20Warning: The connection.execute() method in SQLAlchemy 2.0 will accept parameters as a single dictionary"
  • Loading branch information
jdavcs committed Dec 11, 2023
1 parent 5dbb057 commit aba2614
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/galaxy/quota/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def get_quota(self, user, quota_source_label=None) -> Optional[int]:
)
conn = self.sa_session.connection()
with conn.begin():
res = conn.execute(query, is_true=True, user_id=user.id, label=quota_source_label).fetchone()
res = conn.execute(query, {"is_true": True, "user_id": user.id, "label": quota_source_label}).fetchone()
if res:
return int(res[0]) if res[0] else None
else:
Expand All @@ -191,7 +191,9 @@ def _default_quota(self, default_type, quota_source_label):

conn = self.sa_session.connection()
with conn.begin():
res = conn.execute(query, is_true=True, label=quota_source_label, default_type=default_type).fetchone()
res = conn.execute(
query, {"is_true": True, "label": quota_source_label, "default_type": default_type}
).fetchone()
if res:
return res[0]
else:
Expand Down

0 comments on commit aba2614

Please sign in to comment.