Skip to content

Commit

Permalink
Merge pull request #6327 from chrisburr/fts-sqlalchemy-deprecation
Browse files Browse the repository at this point in the history
[8.0] Replace deprecated Subquery coercion with explicit select
  • Loading branch information
chaen authored Aug 18, 2022
2 parents 5cdca70 + 37796e8 commit 14dc98d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DIRAC/DataManagementSystem/DB/FTS3DB.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.sql.expression import and_
from sqlalchemy.orm import relationship, sessionmaker, mapper
from sqlalchemy.sql import update, delete
from sqlalchemy.sql import update, delete, select
from sqlalchemy import (
create_engine,
Table,
Expand Down Expand Up @@ -541,7 +541,7 @@ def getNonFinishedOperations(self, limit=20, operationAssignmentTag="Assigned"):

# We need to do the select in two times because the join clause that makes the limit difficult
# We get the list of operations ID that have associated jobs assigned
opIDsWithJobAssigned = session.query(FTS3Job.operationID).filter(~FTS3Job.assignment.is_(None)).subquery()
opIDsWithJobAssigned = select(FTS3Job.operationID).filter(~FTS3Job.assignment.is_(None))
operationIDsQuery = (
session.query(FTS3Operation.operationID)
.filter(FTS3Operation.status.in_(["Active", "Processed"]))
Expand Down

0 comments on commit 14dc98d

Please sign in to comment.