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

fix(study-search): correct the SQL query used for pagination #1986

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

laurent-laporte-pro
Copy link
Contributor

@laurent-laporte-pro laurent-laporte-pro commented Mar 25, 2024

Fix Pagination Issue in _search_studies Method

In this PR, I've fixed a bug in the _search_studies method in the repository.py file. The bug was causing issues with pagination because joinedload was being used unnecessarily when we already had a classic join in our query.

By avoiding the use of joinedload, the pagination issue has been resolved. Now, the SQL query is correctly generated by SqlAlchemy in the case of pagination (using LIMIT and OFFSET).

I've also updated the unit tests in the test_repository.py file to ensure that the pagination works as expected.

@laurent-laporte-pro laurent-laporte-pro added this to the v2.17 milestone Mar 25, 2024
@laurent-laporte-pro laurent-laporte-pro self-assigned this Mar 25, 2024
@laurent-laporte-pro laurent-laporte-pro force-pushed the bugfix/study-search-pagination-v2 branch from 62a5908 to 969d7cd Compare March 25, 2024 19:11
@laurent-laporte-pro laurent-laporte-pro force-pushed the bugfix/study-search-pagination-v2 branch from 969d7cd to af62c83 Compare March 25, 2024 20:15
@laurent-laporte-pro laurent-laporte-pro force-pushed the bugfix/study-search-pagination-v2 branch from af62c83 to 88f9a09 Compare March 26, 2024 12:18
@mabw-rte mabw-rte merged commit 9e971f4 into dev Mar 26, 2024
7 checks passed
@mabw-rte mabw-rte deleted the bugfix/study-search-pagination-v2 branch March 26, 2024 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants