Skip to content

Commit

Permalink
Testing: Resolve SADeprecationWarning rucio#5522
Browse files Browse the repository at this point in the history
Sqlalchemy throws the warning:
```
sqlalchemy.exc.SADeprecationWarning: Invoking or_() without arguments is
deprecated, and will be disallowed in a future release.  For an empty or_()
construct, use or_(False, *args).
```

This comes due to an invalid check of the `rse_clause` variable. If it is an
empty list, the expression `rse_clause is not None` will yield `True`, while it
should be `False`.
  • Loading branch information
Joel Dierkes committed May 4, 2022
1 parent b5417e2 commit b44daa7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rucio/core/replica.py
Expand Up @@ -819,7 +819,7 @@ def _list_replicas_for_constituents(constituent_clause, state_clause, files_wo_r
if state_clause is not None:
constituent_query = constituent_query.filter(and_(state_clause))

if rse_clause is not None:
if rse_clause:
constituent_query = constituent_query.filter(or_(*rse_clause))

if updated_after:
Expand Down

0 comments on commit b44daa7

Please sign in to comment.