featurebyte.FeatureList.create_new_version¶
Description¶
Creates a new feature version from a FeatureList object. The current default version of the features within the feature list is employed to create the new version, except when specific versions are indicated by the feature's parameter.
Parameters¶
- features: Union[List[FeatureVersionInfo], NoneType]
List specific feature versions that must be used in the new FeatureList object instead of the default version. Each feature version in the list is defined by using the FeatureVersionInfo constructor that takes as input the feature name and the version.
Returns¶
- FeatureList
Newly created feature list with the specified features or the latest default versions of features.
Raises¶
- RecordCreationException
When failed to save a new version, e.g. when the created feature list is exactly the same as the current one. Another reason could be that the specified feature infeatures
parameter does not exist.
Examples¶
Retrieve feature list & check its features.
>>> feature_list = catalog.get_feature_list("invoice_feature_list")
>>> feature_list.list_features()[["name", "version"]]
name version
0 InvoiceCount_60days V230330
>>> current_feature = feature_list["InvoiceCount_60days"]
>>> new_feature = current_feature.create_new_version(
... table_feature_job_settings=[
... fb.TableFeatureJobSetting(
... table_name="GROCERYINVOICE",
... feature_job_setting=fb.FeatureJobSetting(
... blind_spot="60s",
... frequency="3600s",
... time_modulo_frequency="90s",
... )
... )
... ]
... )
>>> new_feature.update_default_version_mode("MANUAL")
>>> new_feature.as_default_version()
>>> new_feature.is_default is True and current_feature.is_default is False
True
>>> new_feature_list = feature_list.create_new_version()
>>> new_feature_list.list_features()[["name", "version"]]
name version
0 InvoiceCount_60days V230330_1