-
Notifications
You must be signed in to change notification settings - Fork 47
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
Group By failed with date_trunc #148
Comments
Hi @rcourivaud thanks for your bug report. I think it would be easier to fix the bug if you could provide a Minimal Reproducible Example. |
Finally, after few tests, the error is also on the older versions. But it works fine with other postgres drivers. For the example :
You can test with this file |
Hi @rcourivaud, that's closer to a Minimal Reproducible Example, but not quite there yet. For instance a MinRep should be all in one file. Also, I can't see any code to set up the table? The idea is to produce a script that anyone can run that reproduces the problem. |
I don't really understand but this query runs well with pg8000 driver 1.30.3 but fails with the new version
db.query(
Invoice.energy,
func.date_trunc("month", Invoice.date).label("month"),
func.sum(Invoice.consumption).label("consumption"),
)
query = query.group_by(Invoice.energy, func.date_trunc("month", Invoice.date))
The text was updated successfully, but these errors were encountered: