How do I group query results by the hour part of a datetime column in SQLAlchemy?
If I remember correctly you must first extract the hour from your timestamp and then you can group by that.
query(extract('hour', timeStamp).label('h')).group_by('h')