-
Notifications
You must be signed in to change notification settings - Fork 609
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
feat(join): support _.col.upper()
and lambda left, right: ...
as predicates
#10703
Comments
After @kszucs's comment, I think this needs more general discussion of the spec before I dive into an implementation. After thinking about it and experimenting with current behavior, I have a more generalized proposal for how to adjust join conditions. "Single" ValuesCurrently, if given something that is "singular", it should be resolved against each table individually, and then combined with ==. This is good behavior, I want to keep this, and just add the ability to pass
|
lambda left, right: ...
as predicates
lambda left, right: ...
as predicates_.col.upper()
and lambda left, right: ...
as predicates
Don't want to further complicate it, but deferreds actually support multiple placeholders, not just l, r = var("l"), var("r")
left_table.join(right_table, l.field_a == r.field_a && r.field_b == l.field_b) |
Oh wow, I didn't know about that. That's not a part of the public API though, right? Are you saying there is a way to use this API to support one of the use cases I describe above? Am I correct here: It requires the relation name to match the var name, eg |
Is your feature request related to a problem?
I have these two tables, which I want to join regardless of capitalization. I want to be able to do this:
Currently I have to actually pass
tl.f.upper() == tr.f.upper()
.Another problem I have is reusing my predicates. I want to be able to do all of these:
Currently, I have to reference the tables directly in the predicates, so I have to actually do the binding at right-before-join time, which prevents me from being able to reuse them.
Describe the solution you'd like
See below
Code of Conduct
The text was updated successfully, but these errors were encountered: