Chore/upgrade flask-sqlalchemy 2.4.0 #1848
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary | Résumé
It looks like we haven't upgraded flask-sqlalchemy in 4 years, since someone pinned it to a github sha in order to use an unreleased feature: 47c403f
The feature is the addition of a
count: bool
arg to thepaginate
function. This feature is now live in flask-sqlalchemy 3.0.0, but we haven't been able to take an incremental approach to upgrading to it because we are stuck on this weird, unreleased version of 2.3.2.We are only setting
count=False
in one place as far as I can tell: https://github.com/cds-snc/notification-admin/blob/main/app/notify_client/notification_api_client.py#L67And that is on the api page where the most recent notifications (i.e. "page 1") are listed. So this change may make that page load slowly for services with a lot of notifications - we will need to test that. If that is a problem, we could add an argument that would allow the admin to specify how many notifications should be returned in the query.