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

Limit on list_<type> has unintuitive behaviour #380

Open
MortGron opened this issue Nov 25, 2024 · 0 comments
Open

Limit on list_<type> has unintuitive behaviour #380

MortGron opened this issue Nov 25, 2024 · 0 comments

Comments

@MortGron
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Let ut say A has a property b which is a direct relation to B. Let us also say that the property b points to more than 5 different Bs, but that multiple As might point to the same B.

If you write
client.A.select().b.list_b(limit=5)
you would expect 5 different/unique Bs to be listed, but the current behaviour is that five Bs are retrieved, and since multiple As point to the same B you might end up with fewer than 5 Bs in the result.

Describe the solution you'd like
A new argument to list_b that ensures you limit the result to the specified number of unique results.

Describe alternatives you've considered
If the limit had been in the "select" clause of the query and not in the "with" clause, the intuitive behaviour might be achived.

Additional context
Add any other context or screenshots about the feature request here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant