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 counts on list users queries #4794

Merged
merged 2 commits into from Apr 19, 2024
Merged

Conversation

minrk
Copy link
Member

@minrk minrk commented Apr 19, 2024

we had some joins to trigger eager loading,
but then query.count() returns the count of (user, group) and (user, spawner) pairs, not the count of users but the joinedload options added later are the right way to do that, so these joins are unnecessary

closes #4789

we had some joins to trigger eager loading,
but then `query.count()` returns the count of (user, group) and (user, spawner) pairs, not the count of users
but the `joinedload` options added later are the right way to do that,
so these joins are unnecessary
@minrk minrk added the bug label Apr 19, 2024
add_user(db, app, name=name)
print(f"{db.query(orm.User).count()} total users")
user = add_user(db, app, name=name)
if i % 2:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline comment here would be helpful

Copy link
Member

@consideRatio consideRatio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked but didn't feel confident reviewing this :/

I suggest self-review and then go for merge. I'm out of time to review much today/this week

@minrk
Copy link
Member Author

minrk commented Apr 19, 2024

going to resolve the docker timeout in #4795

@minrk minrk merged commit 168fa5c into jupyterhub:main Apr 19, 2024
18 of 19 checks passed
@minrk minrk deleted the pagination-count branch April 19, 2024 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pagination total is not correct with named servers
2 participants