def METHOD_NAME(df):
    sql = """
    SELECT
        passenger_count,
        pickup_datetime,
        CAST(trip_distance AS int) AS trip_distance,
        COUNT(*) AS the_count
    FROM trips
    GROUP BY
        passenger_count,
        pickup_datetime,
        trip_distance
    ORDER BY
        pickup_datetime,
        the_count desc
    """
    df["pickup_datetime"] = df["pickup_datetime"].dt.year
    df["trip_distance"] = df["trip_distance"].astype("int64")
    return query(sql, trips=df)