Skip to content

featurebyte.AddTimestampSchema

class AddTimestampSchema(
*,
type: Literal["add_timestamp_schema"]="add_timestamp_schema",
timestamp_schema: TimestampSchema
)

Description

The AddTimestampSchema class adds missing timestamp schema information to a table column. This includes details such as the format string, whether the timestamp is in UTC, and the timezone.

Important: Do not use this column cleaning operation if the table registration already contains a timestamp schema input (for example, the reference_datetime_schema provided in the table registration via the create_time_series_table method). In such cases, the timestamp schema has been specified and this operation is unnecessary.

Note that when used, this operation should be the last step in the cleaning operation list. When this operation is applied, the semantic type of the column will be reset to None.

Parameters

  • type: Literal["add_timestamp_schema"]
    default: "add_timestamp_schema"

  • timestamp_schema: TimestampSchema
    Timestamp schema to be added to the column.

Examples

Create a cleaning operation to add timestamp schema to the column with format string "YYYY-MM-DD HH24:MI:SS" where the timestamp is in UTC time and the timezone is "Asia/Singapore". Note that the format is specific to the underlying database and is used to parse the timestamp values.

>>> fb.AddTimestampSchema(
...     timestamp_schema=fb.TimestampSchema(
...         format_string="YYYY-MM-DD HH24:MI:SS", is_utc_time=True, timezone="Asia/Singapore"
...     )
... )  # doctest: +SKIP

See Also

  • TimestampSchema: Schema for a timestamp column that can include timezone information.