The result should be Date object
Since the day cannot be \'removed\', set it to say, 1st day of the month.
Leaving only Month, Year
if you declare your schema like this,
schema.Column('created', types.TIMESTAMP(), default=now()),
the function now() is defined in the same module which can be like this
def now():
now_date = datetime.datetime.now()
return now_date.replace(day=1)
as per group_by requirement, here is a method mentioned.
you can modify hour and other field similarly.