Skip to content

Commit

Permalink
Fix SA2.0 compatibility: joinedload does not take str args
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavcs committed Feb 12, 2024
1 parent 6b588d7 commit 37d0a92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/cleanup_datasets/cleanup_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def purge_histories(app, cutoff_time, remove_from_disk, info_only=False, force_r
histories = (
app.sa_session.query(app.model.History)
.filter(and_(app.model.History.__table__.c.deleted == true(), app.model.History.update_time < cutoff_time))
.options(joinedload("datasets"))
.options(joinedload(app.model.History.datasets))
)
else:
histories = (
Expand All @@ -273,7 +273,7 @@ def purge_histories(app, cutoff_time, remove_from_disk, info_only=False, force_r
app.model.History.update_time < cutoff_time,
)
)
.options(joinedload("datasets"))
.options(joinedload(app.model.History.datasets))
)
for history in histories:
log.info("### Processing history id %d (%s)", history.id, unicodify(history.name))
Expand Down

0 comments on commit 37d0a92

Please sign in to comment.