-
Notifications
You must be signed in to change notification settings - Fork 514
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
Add where
parameter to union_relations
#554
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for submitting this and for including both integration tests plus documentation 🏆
Thank you also for alerting about the branch names within the merge request template being out-of-date; those are updated now.
Review
Only feedback:
- I'd like to move the
where
parameter to be at the end of the argument list so we can guarantee no accidental breakage for any consumers.
Is there any reason why it would be beneficial or necessary to be the first keyword argument?
Question:
- It looks like the same filter specified by the
where
parameter will be applied to every relation; I'm assuming you haven't needed unique filters per relation as often?
Aside
At first, I was wondering if this would conflict or overlap with the where config, but it looks like it is only for test resources.
b2734cd
to
aa96b18
Compare
@dbeatty10 Thanks for the feedback! I've made the changes and tests are passing. I rebased locally onto |
Sorry for the dramatic delay in conversation @LewisDavies Could I bother you for two more changes and then we can merge this in?
If you don't have the time, just let me know and I can do those two steps too. Thank you so much for your detailed solution on this! |
aa96b18
to
23fd24d
Compare
2f3b13d
to
5bde6bc
Compare
@dbeatty10 No worries, the changes are all done. Since I rebased off main I updated the target branch too. With all my testing and rebasing the commits were an absolute mess, so I cleaned them up and force pushed again. Should be good to go now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks awesome, @LewisDavies ! This rocks 🎸
Resolves #464, resolves #382
This is a:
main
dev/
branchdev/
branchDescription & motivation
I often want to add basic filters when using
union_relations
, such as excluding obsolete records or low-quality data. Currently, I have to create two models to do so: one to union the data then another to filter it. This PR adds awhere
parameter tounion_relations
so models are filtered before being unioned.More context & discussion can be found in #464 and #382.
Checklist