-
Notifications
You must be signed in to change notification settings - Fork 46
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
CTEUpdateQueryCompiler as_sql passes extraneous arguments to superclass method #7
Comments
Tagging @millerdev , per @czue's recommendation. |
@MisterNando this is a strange error. I'm unable to tell from the given traceback how If you cannot do that, can you find out what the values of class CTEUpdateQueryCompiler(SQLUpdateCompiler):
def as_sql(self, *args, **kwargs):
print(args, kwargs) # <---- capture the output of this when the error occurs
def _as_sql():
return super(CTEUpdateQueryCompiler, self).as_sql(*args, **kwargs)
return CTECompiler.generate_sql(self.connection, self.query, _as_sql) |
Thanks for responding, @millerdev ! I can no longer reproduce the conditions that resulted in the error; however, I was able to dig up a more detailed stacktrace from our log archives:
It looks like the Django SQLCompiler is calling as_sql() with itself and the DB connection as arguments (line 373 in compiler.py). Does this provide you with the information that you need to proceed with your debugging? |
CTEUpdateQueryCompiler inherits from SQLUpdateCompiler, and overrides its as_sql method. However, the overridden method accepts arguments, whereas the parent method does not*, and the child method tries to pass those arguments to the parent method, resulting in a TypeError (see below).
*at least not in the current version of Django, and as far back as 1.11.4
Child method:
Parent method:
Observed error:
The text was updated successfully, but these errors were encountered: