I'm trying to bin some events by month.
date_list = func.generate_series(start, end, '1 month')
db.session.query(func.count(Event.id)).join(date_list, true()).outerjoin(Event, Event.time==func.date(date_list)).all()
But I'm getting an error:
NotSupportedError: (psycopg2.errors.FeatureNotSupported) set-returning functions are not allowed in JOIN conditions
What's a simple example of using a series on the left side of the join with SQLAlchemy, and then using an aggregate like count?