View source on GitHub
|
Generates yearly date intervals.
Inherits From: DateRangeBucketer
schema.utils.date_range_bucketing.YearlyDateRangeGenerator(
input_dates: Sequence[datetime.date]
)
Args | |
|---|---|
input_dates
|
A sequence of datetime.date objects representing the range
of dates to generate intervals for.
|
Methods
generate_date_intervals
generate_date_intervals() -> Iterator[DateInterval]
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.
|
View source on GitHub