def normalize_data_query_bounds(lower, upper, time, tz):
    # Subtract one day to grab things that happened on the first day we are
    # requesting. This doesn't need to be a trading day, we are only adding
    # a lower bound to limit the amount of in memory filtering that needs
    # to happen.
    lower -= datetime.timedelta(days=1)
    if time is not None:
        return normalize_data_query_time(
            lower,
            time,
            tz,
        ), normalize_data_query_time(
            upper,
            time,
            tz,
        )
    return lower, upper
Adjust the first and last dates in the requested datetime index based on
dataset/ETHPy150Open quantopian/zipline/zipline/pipeline/loaders/utils.py/normalize_data_query_bounds