-
Notifications
You must be signed in to change notification settings - Fork 151
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
TupleLoader distinct on all included loaders #324
base: master
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 1148
💛 - Coveralls |
Thanks for the PR! As you said, it's not always true that all results in sub-loaders are distinct. I also understand from the added test case. But it's also not always true that all results have to be distinct to make this tuple distinct, depending on use cases. For example, I want to iterate through (company, team) pairs instead of company.teams which needs two levels of for-loops. |
Hm... i have an idea, TupleLoader must also relay on |
By One way to get what you want may be to check each returned tuple, and save it to context, like |
I mean, when you have query result like that, with
we can automaticaly find it in |
I'm not sure I get what you mean. Like this? TupleLoader(
(
User.load(add_company=Company),
ColumnLoader(query.c.test_column),
),
group_by=User,
) |
684f7b1
to
3969c27
Compare
d3bba04
to
79e7d4c
Compare
When using TupleLoader with complex query like: (ModelOne.distinct(ModelOne.id).load(...=ModelTwo.distinct...), CustomLoader(query.column_name))
result is incorrect, becase, it assumes that all rows results from each loader are distinct which is not always true