Skip to content

Commit

Permalink
Transfers: Fix SAWarnings for coerced subqueries rucio#5522
Browse files Browse the repository at this point in the history
  • Loading branch information
rdimaio committed Jan 15, 2024
1 parent 8a29a5c commit cd0e344
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/rucio/core/request.py
Expand Up @@ -1973,7 +1973,7 @@ def release_waiting_requests_per_deadline(
old_requests_subquery,
and_(filtered_requests_subquery.c.dataset_name == old_requests_subquery.c.name,
filtered_requests_subquery.c.dataset_scope == old_requests_subquery.c.scope)
).subquery()
)

amount_released_requests = update(
models.Request
Expand Down Expand Up @@ -2045,7 +2045,7 @@ def release_waiting_requests_per_free_volume(
filtered_requests_subquery.c.dataset_scope == cumulated_volume_subquery.c.scope)
).where(
cumulated_volume_subquery.c.cum_volume <= volume - sum_volume_active_subquery.c.sum_bytes
).subquery()
)

amount_released_requests = update(
models.Request
Expand Down Expand Up @@ -2185,8 +2185,6 @@ def release_waiting_requests_fifo(
if account is not None:
subquery = subquery.where(models.Request.account == account)

subquery = subquery.subquery()

if dialect == 'mysql':
# TODO: check if the logic from this `if` is still needed on modern mysql

Expand All @@ -2198,7 +2196,7 @@ def release_waiting_requests_fifo(
models.Request.id == subquery.c.id
).subquery()
# wrap select to update and select from the same table
subquery = select(subquery.c.id).subquery()
subquery = select(subquery.c.id)

stmt = update(
models.Request
Expand Down Expand Up @@ -2263,7 +2261,7 @@ def release_waiting_requests_grouped_fifo(
).subquery()

# needed for mysql to update and select from the same table
cumulated_children_subquery = select(cumulated_children_subquery.c.id).subquery()
cumulated_children_subquery = select(cumulated_children_subquery.c.id)

stmt = update(
models.Request
Expand Down

0 comments on commit cd0e344

Please sign in to comment.