prefixes: Optional[Tuple[Optional[str], Optional[str]]]=None,
view_mode: Literal[ViewMode.AUTO, ViewMode.MANUAL]="auto",
column_cleaning_operations: Optional[List[ColumnCleaningOperation]]=None) -> ChangeView
Gets a ChangeView from a Slowly Changing Dimension (SCD) table. The view offers a method to examine alterations that occur in a specific attribute within the natural key of the SCD table.
To create the ChangeView, you need to provide the name of the SCD column for which you want to track changes through the track_changes_column parameter.
- you can define the default Feature Job Setting for the View. Default is once a day, at the time of the creation of the view.
- you can provide a
prefixparameter to control how the views columns are named.
The resulting view has 5 columns:
- the natural key of the SCDView
: value of the column before the change
: value of the column after the change
- past_valid_from_timestamp (equal to the effective timestamp of the SCD before the change)
- new_valid_from_timestamp (equal to the effective timestamp of the SCD after the change)
The ChangeView can be used to create Aggregates of Changes Over a Window features, similar to Aggregates Over a Window features created from an Event View.
- track_changes_column: str
Name of the column to track changes for.
- default_feature_job_setting: Optional[FeatureJobSetting]
Default feature job setting to set with the FeatureJobSetting constructor. If not provided, the default feature job setting is daily, aligning with the view's creation time.
- prefixes: Optional[Tuple[Optional[str], Optional[str]]]
Optional prefixes where each element indicates the prefix to add to the new column names for the name of the column that we want to track. The first prefix will be used for the old, and the second for the new. If not provided, the column names will be prefixed with the default values of "past_", and "new_". At least one of the values must not be None. If two values are provided, they must be different.
- view_mode: Literal[ViewMode.AUTO, ViewMode.MANUAL]
View mode to use. When auto, the view will be constructed with cleaning operations.
- drop_column_names: Optional[List[str]]
List of column names to drop (manual mode only).
- column_cleaning_operations: Optional[List[ColumnCleaningOperation]]
List of cleaning operations to apply per column in manual mode only. Each element in the list indicates the cleaning operations for a specific column. The association between this column and the cleaning operations is established via the ColumnCleaningOperation constructor.
ChangeView object constructed from the SCD source table.