-
Notifications
You must be signed in to change notification settings - Fork 308
ComplexCriterion does not use aliases #673
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
Comments
I was just bitten by this. |
A workaround solution for now. from pypika.utils import format_alias_sql
try:
_original_ComplexCriterion_get_sql
except NameError:
_original_ComplexCriterion_get_sql = ComplexCriterion.get_sql
def _patched_get_sql(self, *args, **kwargs):
return format_alias_sql(
_original_ComplexCriterion_get_sql(self, *args, **kwargs), self.alias, **kwargs)
ComplexCriterion.get_sql = _patched_get_sql |
see #735 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It appears that ComplexCriterion ignores an alias attached to it. From the code I can see that other criteria have a signature like
def get_sql(self, with_alias: bool = False, ...)
, butComplexCriterion
lacks that handling ofwith_alias
.Consequently, when I do something like
the SQL version will not include that
my_alias
.The text was updated successfully, but these errors were encountered: