Skip to content

Conversation

@dnwpark
Copy link
Contributor

@dnwpark dnwpark commented Sep 25, 2025

close #838

Ensures a splat is applied in the following cases:

default.User
default.User.filter(...)
default.User.groups
default.User.groups.filter(...)
default.User.filter(...).groups
default.User.filter(...).groups.filter(...)

Also ensures that splats are applied if such a case is used within another object's select.

default.Group.select(
    users=default.Post.author  # splat applied here
)

@dnwpark dnwpark force-pushed the implicit-select-splat branch 2 times, most recently from 00201cc to 691103a Compare September 25, 2025 23:54
@dnwpark dnwpark marked this pull request as ready for review September 26, 2025 00:10
@dnwpark dnwpark force-pushed the implicit-select-splat branch 2 times, most recently from 4a7d92a to f458874 Compare September 26, 2025 01:59
Comment on lines 202 to 204
elif isinstance(kwarg, _qb.BaseAlias) and issubclass(
kwarg.__gel_origin__, _qb.GelObjectTypeMetadata
):
Copy link
Member

Choose a reason for hiding this comment

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

I would try to merge these cases, instead of duplicating the bodies?

@dnwpark dnwpark force-pushed the implicit-select-splat branch from f458874 to a903234 Compare September 26, 2025 20:15
@dnwpark dnwpark merged commit e8677d5 into master Sep 26, 2025
43 checks passed
@dnwpark dnwpark deleted the implicit-select-splat branch September 26, 2025 22:02
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

Successfully merging this pull request may close these issues.

Make the query builder behave consistently w.r.t. having or not having .select()

3 participants