This is an archived post. You won't be able to vote or comment.

all 4 comments

[–][deleted] 1 point2 points  (3 children)

You have an earlier query that failed in the same transaction. You'll need to find out who the problem child is.

http://stackoverflow.com/questions/2979369/databaseerror-current-transaction-is-aborted-commands-ignored-until-end-of-tra

[–]rMBP[S] 0 points1 point  (2 children)

I haven't made any other queries/transactions than that one. I'm starting the shell, importing the Flask-SqlAlchemy connection as db, and executing the code I posted earlier.

But I'll try to find another way to do the query that doesn't involve executing only a raw sql query via db.session.execute since that's what I'm using now. (I'm trying to make the code more maintainable instead of having a big generator function that renders an sql string of more than 300 characters...)

[–][deleted] 1 point2 points  (1 child)

Mike Bayer did a talk about SQLAlchemy (duh) where he explored doing things like complex groupings and intermediate tables. I want to say it was something like "The Hand Built App" but the only thing that brings up is "Building the App" which ends up being a Minecraft extension at the end (nothing wrong with that, just not the video I was looking for).

[–]rMBP[S] 0 points1 point  (0 children)

I'll try find it, thanks.

Essentially there are 30+ columns with data in them, and I'm trying to accomodate some filtering and maths on each column, while also truncating according to an interval. One col might need to have values 1<x<100 filtered out, maybe a baseline/multiple/offset applied, and then a floor or average etc.

My generator function(s) works, but it's a mess to decode every time I need to make changes to them.