schema.utils.date_range_bucketing.YearlyDateRangeGenerator

Generates yearly date intervals.

Inherits From: DateRangeBucketer

input_dates A sequence of datetime.date objects representing the range of dates to generate intervals for.

Methods

generate_date_intervals

View source

Generates DateInterval protos for the class's input dates.

Each interval represents a month, quarter, or year, depending on the instance of this class. An interval is excluded if the start date is not the first available date (in self._input_dates) for the time bucket. The last interval in self._input_dates is excluded in all cases.

Returns
An iterator over generated TimeIntervals.