Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve Warnings in tests #5522

Closed
joeldierkes opened this issue May 4, 2022 · 0 comments
Closed

Resolve Warnings in tests #5522

joeldierkes opened this issue May 4, 2022 · 0 comments
Assignees
Milestone

Comments

@joeldierkes
Copy link
Contributor

Motivation

Rucio is throwing Warnings in the tests. We should resolve them.
https://github.com/rucio/rucio/runs/6283942231?check_suite_focus=true#step:4:3116

=============================== warnings summary ===============================
../core/did_meta_plugins/filter_engine.py:362
  /opt/rucio/lib/rucio/core/did_meta_plugins/filter_engine.py:362: DeprecationWarning: invalid escape sequence \_
    expression = json_column[key].as_string().notlike(value.replace('*', '%').replace('_', '\_'), escape='\\')  # NOQA: W605

../core/did_meta_plugins/filter_engine.py:360
  /opt/rucio/lib/rucio/core/did_meta_plugins/filter_engine.py:360: DeprecationWarning: invalid escape sequence \_
    expression = json_column[key].as_string().like(value.replace('*', '%').replace('_', '\_'), escape='\\')     # NOQA: W605

../core/did_meta_plugins/filter_engine.py:340
  /opt/rucio/lib/rucio/core/did_meta_plugins/filter_engine.py:340: DeprecationWarning: invalid escape sequence \_
    expression = key.notlike(value.replace('*', '%').replace('_', '\_'), escape='\\')  # NOQA: W605

../core/did_meta_plugins/filter_engine.py:338
  /opt/rucio/lib/rucio/core/did_meta_plugins/filter_engine.py:338: DeprecationWarning: invalid escape sequence \_
    expression = key.like(value.replace('*', '%').replace('_', '\_'), escape='\\')     # NOQA: W605
...

Modification

Just resolve the Warnings.

@joeldierkes joeldierkes self-assigned this May 4, 2022
joeldierkes pushed a commit to joeldierkes/rucio that referenced this issue May 4, 2022
There are multiple Warnings (like `DeprecationWarning`s,
`PendingDeprecationWarning`s, `SAWarning`s, ...) in our project. This commit
resolves them.
joeldierkes pushed a commit to joeldierkes/rucio that referenced this issue May 4, 2022
The `token_file` in the baseclient is not closed immediately after its usage. It
gets closed once the garbage collector deletes the FileHandler, but this happens
after an unspecified amount of time. This leads to the `ResourceWarning`.
joeldierkes pushed a commit to joeldierkes/rucio that referenced this issue May 4, 2022
There are multiple Warnings (like `DeprecationWarning`s,
`PendingDeprecationWarning`s, `SAWarning`s, ...) in our project. This commit
resolves them.
joeldierkes pushed a commit to joeldierkes/rucio that referenced this issue May 4, 2022
The `token_file` in the baseclient is not closed immediately after its usage. It
gets closed once the garbage collector deletes the FileHandler, but this happens
after an unspecified amount of time. This leads to the `ResourceWarning`.
joeldierkes pushed a commit to joeldierkes/rucio that referenced this issue May 4, 2022
The `Inspector.has_table()` method replaces the `Engine.has_table()` method
since version 1.4.
joeldierkes pushed a commit to joeldierkes/rucio that referenced this issue May 4, 2022
Sqlalchemy throws this exception:
`sqlalchemy.exc.SAWarning: Coercing Subquery object into a select() for use in
IN(); please pass a select() construct explicitly`

Sqlalchemy does not need a subquery for the `_in` query.
joeldierkes pushed a commit to joeldierkes/rucio that referenced this issue May 4, 2022
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`.
rcarpa added a commit to rcarpa/rucio that referenced this issue Aug 26, 2022
/opt/rucio/lib/rucio/core/replica.py:4272: SADeprecationWarning: Invoking or_() without arguments is deprecated, and will be disallowed in a future release.   For an empty or_() construct, use or_(False, *args).
    replica_query = replica_query.filter(or_(*rse_clause))
rcarpa added a commit to rcarpa/rucio that referenced this issue Aug 26, 2022
SAWarning: Coercing Subquery object into a select() for use in IN(); please pass a select() construct explicitly
rcarpa added a commit to rcarpa/rucio that referenced this issue Sep 2, 2022
/opt/rucio/lib/rucio/core/replica.py:4272: SADeprecationWarning: Invoking or_() without arguments is deprecated, and will be disallowed in a future release.   For an empty or_() construct, use or_(False, *args).
    replica_query = replica_query.filter(or_(*rse_clause))
rcarpa added a commit to rcarpa/rucio that referenced this issue Sep 5, 2022
/opt/rucio/lib/rucio/core/replica.py:4272: SADeprecationWarning: Invoking or_() without arguments is deprecated, and will be disallowed in a future release.   For an empty or_() construct, use or_(False, *args).
    replica_query = replica_query.filter(or_(*rse_clause))
bari12 pushed a commit that referenced this issue Sep 5, 2022
/opt/rucio/lib/rucio/core/replica.py:4272: SADeprecationWarning: Invoking or_() without arguments is deprecated, and will be disallowed in a future release.   For an empty or_() construct, use or_(False, *args).
    replica_query = replica_query.filter(or_(*rse_clause))
rdimaio added a commit to rdimaio/rucio that referenced this issue Jan 12, 2024
rdimaio added a commit to rdimaio/rucio that referenced this issue Jan 15, 2024
@bari12 bari12 added this to the 33.2.2 / 33.3.0 milestone Jan 17, 2024
@bari12 bari12 closed this as completed Jan 17, 2024
voetberg pushed a commit to voetberg/rucio that referenced this issue Mar 21, 2024
voetberg pushed a commit to voetberg/rucio that referenced this issue Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants