Filter Tasks¶
ecoscope.platform.tasks.filter ¶
Attributes¶
UTC_TIMEZONEINFO
module-attribute
¶
UTC_TIMEZONEINFO = TimezoneInfo(label='UTC', tzCode='UTC', name='UTC', utc_offset='+00:00')
Classes¶
TimeRange ¶
Bases: BaseModel
Attributes¶
Methods:¶
ensure_timezone_awareness ¶
ensure_timezone_awareness() -> TimeRange
Source code in ecoscope/platform/tasks/filter/_filter.py
Functions:¶
get_timezone_from_time_range ¶
get_timezone_from_time_range(time_range: TimeRange) -> Annotated[TimezoneInfo, Field()]
Utility function to return the TimezoneInfo object nested in the provided TimeRange in workflow specs
Source code in ecoscope/platform/tasks/filter/_filter.py
set_time_range ¶
set_time_range(since: Annotated[datetime, Field(description='The start time')], until: Annotated[datetime, Field(description='The end time')], timezone: Annotated[TimezoneInfo | SkipJsonSchema[None], Field(default=None)] = None, time_format: Annotated[str, AdvancedField(default=DEFAULT_TIME_FORMAT, description='The time format')] = DEFAULT_TIME_FORMAT) -> Annotated[TimeRange, Field(description='Time range filter')]