featurebyte.ForecastPointSchema¶
class ForecastPointSchema(
*,
granularity: TimeIntervalUnit,
dtype: DBVarType="DATE",
format_string: Optional[str]=None,
is_utc_time: Optional[bool]=None,
timezone: Union[TimeZoneName, TimeZoneColumn, NoneType]=None
)Description¶
Schema for a forecast point column in observation tables. The forecast point represents the future date/time being predicted for, as opposed to POINT_IN_TIME which represents when the prediction is made.
The FORECAST_POINT column is always string-based (DATE, TIMESTAMP, or VARCHAR), and the schema defines how to interpret the granularity and timezone.
Parameters¶
- granularity: TimeIntervalUnit
The time granularity of the forecast point (DAY, WEEK, HOUR, etc.) For WEEK granularity, the column still contains date values (e.g., week start date) - dtype: DBVarType
default: "DATE"
The data type of the forecast point column (DATE, TIMESTAMP, TIMESTAMP_TZ, or VARCHAR) - format_string: Optional[str]
Database-specific format string if the column is stored as VARCHAR. Required for VARCHAR dtype, must not be provided for native date/timestamp types. - is_utc_time: Optional[bool]
Whether the forecast point values are in UTC (True) or local time (False) - timezone: Union[TimeZoneName, TimeZoneColumn, NoneType]
Global timezone setting, or reference to a FORECAST_TIMEZONE column. Required when is_utc_time is False.
Examples¶
Example 1: Daily forecast with local timezone column
>>> forecast_schema = fb.ForecastPointSchema(
... granularity=fb.TimeIntervalUnit.DAY,
... dtype=fb.DBVarType.DATE,
... is_utc_time=False,
... timezone=fb.TimeZoneColumn(column_name="FORECAST_TIMEZONE", type="timezone"),
... )
See Also¶
- TimestampSchema: Schema for a timestamp column that can include timezone information.
- Context: Context class that can include a forecast_point_schema.