For some reason I thought that I was passing datetime objects to the get_hourly_sesssion function. Nope.