SpineGroup#
SpineGroup#
hsfs.feature_group.SpineGroup(
storage_connector=None,
query=None,
data_format=None,
path=None,
options=None,
name=None,
version=None,
description=None,
primary_key=None,
featurestore_id=None,
featurestore_name=None,
created=None,
creator=None,
id=None,
features=None,
location=None,
statistics_config=None,
event_time=None,
expectation_suite=None,
online_enabled=False,
href=None,
online_topic_name=None,
topic_name=None,
spine=True,
dataframe=None,
deprecated=False,
**kwargs
)
Creation#
get_or_create_spine_group#
FeatureStore.get_or_create_spine_group(
name,
version=None,
description="",
primary_key=None,
event_time=None,
features=None,
dataframe=None,
)
Create a spine group metadata object.
Instead of using a feature group to save a label/prediction target, you can use a spine together with a dataframe containing the labels. A Spine is essentially a metadata object similar to a feature group, however, the data is not materialized in the feature store. It only containes the needed metadata such as the relevant event time column and primary key columns to perform point-in-time correct joins.
Example
# connect to the Feature Store
fs = ...
spine_df = pd.Dataframe()
spine_group = fs.get_or_create_spine_group(
name="sales",
version=1,
description="Physical shop sales features",
primary_key=['ss_store_sk'],
event_time='sale_date',
dataframe=spine_df
)
Note that you can inspect the dataframe in the spine group, or replace the dataframe:
spine_group.dataframe.show()
spine_group.dataframe = new_df
The spine can then be used to construct queries, with only one speciality:
Note
Spines can only be used on the left side of a feature join, as this is the base set of entities for which features are to be fetched and the left side of the join determines the event timestamps to compare against.
If you want to use the query for a feature view to be used for online serving, you can only select the label or target feature from the spine. For the online lookup, the label is not required, therefore it is important to only select label from the left feature group, so that we don't need to provide a spine for online serving.
These queries can then be used to create feature views. Since the dataframe contained in the spine is not being materialized, every time you use a feature view created with spine to read data you will have to provide a dataframe with the same structure again.
For example, to generate training data:
X_train, X_test, y_train, y_test = feature_view_spine.train_test_split(0.2, spine=training_data_entities)
Or to get batches of fresh data for batch scoring:
feature_view_spine.get_batch_data(spine=scoring_entities_df).show()
Here you have the chance to pass a different set of entities to generate the training dataset.
Sometimes it might be handy to create a feature view with a regular feature group containing the label, but then at serving time to use a spine in order to fetch features for example only for a small set of primary key values. To do this, you can pass the spine group instead of a dataframe. Just make sure it contains the needed primary key, event time and label column.
feature_view.get_batch_data(spine=spine_group)
Arguments
- name
str
: Name of the spine group to create. - version
int | None
: Version of the spine group to retrieve, defaults toNone
and will create the spine group with incremented version from the last version in the feature store. - description
str | None
: A string describing the contents of the spine group to improve discoverability for Data Scientists, defaults to empty string""
. - primary_key
List[str] | None
: A list of feature names to be used as primary key for the spine group. This primary key can be a composite key of multiple features and will be used as joining key, if not specified otherwise. Defaults to empty list[]
, and the spine group won't have any primary key. - event_time
str | None
: Optionally, provide the name of the feature containing the event time for the features in this spine group. If event_time is set the spine group can be used for point-in-time joins. Defaults toNone
. -
features
List[hsfs.feature.Feature] | None
: Optionally, define the schema of the spine group manually as a list ofFeature
objects. Defaults to empty list[]
and will use the schema information of the DataFrame resulting by executing the provided query against the data source.Event time data type restriction
The supported data types for the event time column are:
timestamp
,date
andbigint
. -
__ dataframe__: DataFrame, RDD, Ndarray, list. Spine dataframe with primary key, event time and label column to use for point in time join when fetching features.
Returns
SpineGroup
. The spine group metadata object.
Retrieval#
get_or_create_spine_group#
FeatureStore.get_or_create_spine_group(
name,
version=None,
description="",
primary_key=None,
event_time=None,
features=None,
dataframe=None,
)
Create a spine group metadata object.
Instead of using a feature group to save a label/prediction target, you can use a spine together with a dataframe containing the labels. A Spine is essentially a metadata object similar to a feature group, however, the data is not materialized in the feature store. It only containes the needed metadata such as the relevant event time column and primary key columns to perform point-in-time correct joins.
Example
# connect to the Feature Store
fs = ...
spine_df = pd.Dataframe()
spine_group = fs.get_or_create_spine_group(
name="sales",
version=1,
description="Physical shop sales features",
primary_key=['ss_store_sk'],
event_time='sale_date',
dataframe=spine_df
)
Note that you can inspect the dataframe in the spine group, or replace the dataframe:
spine_group.dataframe.show()
spine_group.dataframe = new_df
The spine can then be used to construct queries, with only one speciality:
Note
Spines can only be used on the left side of a feature join, as this is the base set of entities for which features are to be fetched and the left side of the join determines the event timestamps to compare against.
If you want to use the query for a feature view to be used for online serving, you can only select the label or target feature from the spine. For the online lookup, the label is not required, therefore it is important to only select label from the left feature group, so that we don't need to provide a spine for online serving.
These queries can then be used to create feature views. Since the dataframe contained in the spine is not being materialized, every time you use a feature view created with spine to read data you will have to provide a dataframe with the same structure again.
For example, to generate training data:
X_train, X_test, y_train, y_test = feature_view_spine.train_test_split(0.2, spine=training_data_entities)
Or to get batches of fresh data for batch scoring:
feature_view_spine.get_batch_data(spine=scoring_entities_df).show()
Here you have the chance to pass a different set of entities to generate the training dataset.
Sometimes it might be handy to create a feature view with a regular feature group containing the label, but then at serving time to use a spine in order to fetch features for example only for a small set of primary key values. To do this, you can pass the spine group instead of a dataframe. Just make sure it contains the needed primary key, event time and label column.
feature_view.get_batch_data(spine=spine_group)
Arguments
- name
str
: Name of the spine group to create. - version
int | None
: Version of the spine group to retrieve, defaults toNone
and will create the spine group with incremented version from the last version in the feature store. - description
str | None
: A string describing the contents of the spine group to improve discoverability for Data Scientists, defaults to empty string""
. - primary_key
List[str] | None
: A list of feature names to be used as primary key for the spine group. This primary key can be a composite key of multiple features and will be used as joining key, if not specified otherwise. Defaults to empty list[]
, and the spine group won't have any primary key. - event_time
str | None
: Optionally, provide the name of the feature containing the event time for the features in this spine group. If event_time is set the spine group can be used for point-in-time joins. Defaults toNone
. -
features
List[hsfs.feature.Feature] | None
: Optionally, define the schema of the spine group manually as a list ofFeature
objects. Defaults to empty list[]
and will use the schema information of the DataFrame resulting by executing the provided query against the data source.Event time data type restriction
The supported data types for the event time column are:
timestamp
,date
andbigint
. -
__ dataframe__: DataFrame, RDD, Ndarray, list. Spine dataframe with primary key, event time and label column to use for point in time join when fetching features.
Returns
SpineGroup
. The spine group metadata object.
Properties#
avro_schema#
Avro schema representation of the feature group.
dataframe#
Spine dataframe with primary key, event time and label column to use for point in time join when fetching features.
deprecated#
Setting if the feature group is deprecated.
embedding_index#
event_time#
Event time feature in the feature group.
feature_store#
feature_store_id#
features#
Feature Group schema (alias)
name#
Name of the feature group.
notification_topic_name#
The topic used for feature group notifications.
primary_key#
List of features building the primary key.
schema#
Feature Group schema
topic_name#
The topic used for feature group data ingestion.
version#
Version number of the feature group.
Methods#
add_tag#
SpineGroup.add_tag(name, value)
Attach a tag to a feature group.
A tag consists of a
Example
# connect to the Feature Store
fs = ...
# get the Feature Group instance
fg = fs.get_or_create_feature_group(...)
fg.add_tag(name="example_tag", value="42")
Arguments
- name
str
: Name of the tag to be added. - value
Any
: Value of the tag to be added.
Raises
hsfs.client.exceptions.RestAPIError
in case the backend fails to add the tag.
check_deprecated#
SpineGroup.check_deprecated()
create_feature_monitoring#
SpineGroup.create_feature_monitoring(
name,
feature_name,
description=None,
start_date_time=None,
end_date_time=None,
cron_expression="0 0 12 ? * * *",
)
Enable feature monitoring to compare statistics on snapshots of feature data over time.
Experimental
Public API is subject to change, this feature is not suitable for production use-cases.
Example
# fetch feature group
fg = fs.get_feature_group(name="my_feature_group", version=1)
# enable feature monitoring
my_config = fg.create_feature_monitoring(
name="my_monitoring_config",
feature_name="my_feature",
description="my monitoring config description",
cron_expression="0 0 12 ? * * *",
).with_detection_window(
# Data inserted in the last day
time_offset="1d",
window_length="1d",
).with_reference_window(
# Data inserted last week on the same day
time_offset="1w1d",
window_length="1d",
).compare_on(
metric="mean",
threshold=0.5,
).save()
Arguments
- name
str
: Name of the feature monitoring configuration. name must be unique for all configurations attached to the feature group. - feature_name
str
: Name of the feature to monitor. - description
str | None
: Description of the feature monitoring configuration. - start_date_time
int | str | datetime.datetime | datetime.date | pandas._libs.tslibs.timestamps.Timestamp | None
: Start date and time from which to start computing statistics. - end_date_time
int | str | datetime.datetime | datetime.date | pandas._libs.tslibs.timestamps.Timestamp | None
: End date and time at which to stop computing statistics. - cron_expression
str | None
: Cron expression to use to schedule the job. The cron expression must be in UTC and follow the Quartz specification. Default is '0 0 12 ? * * *', every day at 12pm UTC.
Raises
hsfs.client.exceptions.FeatureStoreException
.
Return
FeatureMonitoringConfig
Configuration with minimal information about the feature monitoring. Additional information are required before feature monitoring is enabled.
create_statistics_monitoring#
SpineGroup.create_statistics_monitoring(
name,
feature_name=None,
description=None,
start_date_time=None,
end_date_time=None,
cron_expression="0 0 12 ? * * *",
)
Run a job to compute statistics on snapshot of feature data on a schedule.
Experimental
Public API is subject to change, this feature is not suitable for production use-cases.
Example
# fetch feature group
fg = fs.get_feature_group(name="my_feature_group", version=1)
# enable statistics monitoring
my_config = fg.create_statistics_monitoring(
name="my_config",
start_date_time="2021-01-01 00:00:00",
description="my description",
cron_expression="0 0 12 ? * * *",
).with_detection_window(
# Statistics computed on 10% of the last week of data
time_offset="1w",
row_percentage=0.1,
).save()
Arguments
- name
str
: Name of the feature monitoring configuration. name must be unique for all configurations attached to the feature group. - feature_name
str | None
: Name of the feature to monitor. If not specified, statistics will be computed for all features. - description
str | None
: Description of the feature monitoring configuration. - start_date_time
int | str | datetime.datetime | datetime.date | pandas._libs.tslibs.timestamps.Timestamp | None
: Start date and time from which to start computing statistics. - end_date_time
int | str | datetime.datetime | datetime.date | pandas._libs.tslibs.timestamps.Timestamp | None
: End date and time at which to stop computing statistics. - cron_expression
str | None
: Cron expression to use to schedule the job. The cron expression must be in UTC and follow the Quartz specification. Default is '0 0 12 ? * * *', every day at 12pm UTC.
Raises
hsfs.client.exceptions.FeatureStoreException
.
Return
FeatureMonitoringConfig
Configuration with minimal information about the feature monitoring. Additional information are required before feature monitoring is enabled.
delete#
SpineGroup.delete()
Drop the entire feature group along with its feature data.
Example
# connect to the Feature Store
fs = ...
# get the Feature Group instance
fg = fs.get_or_create_feature_group(
name='bitcoin_price',
version=1
)
# delete the feature group
fg.delete()
Potentially dangerous operation
This operation drops all metadata associated with this version of the feature group and all the feature data in offline and online storage associated with it.
Raises
hsfs.client.exceptions.RestAPIError
.
delete_tag#
SpineGroup.delete_tag(name)
Delete a tag attached to a feature group.
Example
# connect to the Feature Store
fs = ...
# get the Feature Group instance
fg = fs.get_or_create_feature_group(...)
fg.delete_tag("example_tag")
Arguments
- name
str
: Name of the tag to be removed.
Raises
hsfs.client.exceptions.RestAPIError
in case the backend fails to delete the tag.
filter#
SpineGroup.filter(f)
Apply filter to the feature group.
Selects all features and returns the resulting Query
with the applied filter.
Example
from hsfs.feature import Feature
# connect to the Feature Store
fs = ...
# get the Feature Group instance
fg = fs.get_or_create_feature_group(...)
fg.filter(Feature("weekly_sales") > 1000)
If you are planning to join the filtered feature group later on with another feature group, make sure to select the filtered feature explicitly from the respective feature group:
Example
fg.filter(fg.feature1 == 1).show(10)
Composite filters require parenthesis and symbols for logical operands (e.g. &
, |
, ...):
Example
fg.filter((fg.feature1 == 1) | (fg.feature2 >= 2))
Arguments
- f
hsfs.constructor.filter.Filter | hsfs.constructor.filter.Logic
: Filter object.
Returns
Query
. The query object with the applied filter.
get_all_statistics#
SpineGroup.get_all_statistics(computation_time=None, feature_names=None)
Returns all the statistics metadata computed before a specific time for the current feature group.
If computation_time
is None
, all the statistics metadata are returned.
Example
# connect to the Feature Store
fs = ...
# get the Feature Group instance
fg = fs.get_or_create_feature_group(...)
fg_statistics = fg.get_statistics(computation_time=None)
Arguments
- computation_time
str | int | float | datetime.datetime | datetime.date | None
: Date and time when statistics were computed. Defaults toNone
. Strings should be formatted in one of the following formats%Y-%m-%d
,%Y-%m-%d %H
,%Y-%m-%d %H:%M
,%Y-%m-%d %H:%M:%S
, or%Y-%m-%d %H:%M:%S.%f
. - feature_names
List[str] | None
: List of feature names of which statistics are retrieved.
Returns
Statistics
. Statistics object.
Raises
hsfs.client.exceptions.RestAPIError
hsfs.client.exceptions.FeatureStoreException
.
get_complex_features#
SpineGroup.get_complex_features()
Returns the names of all features with a complex data type in this feature group.
Example
complex_dtype_features = fg.get_complex_features()
get_feature#
SpineGroup.get_feature(name)
Retrieve a Feature
object from the schema of the feature group.
There are several ways to access features of a feature group:
Example
# connect to the Feature Store
fs = ...
# get the Feature Group instance
fg = fs.get_or_create_feature_group(...)
# get Feature instanse
fg.feature1
fg["feature1"]
fg.get_feature("feature1")
Note
Attribute access to features works only for non-reserved names. For example features named id
or name
will not be accessible via fg.name
, instead this will return the name of the feature group itself. Fall back on using the get_feature
method.
Arguments:
name: The name of the feature to retrieve
Returns:
Feature: The feature object
Raises
hsfs.client.exceptions.FeatureStoreException
.
get_feature_monitoring_configs#
SpineGroup.get_feature_monitoring_configs(name=None, feature_name=None, config_id=None)
Fetch all feature monitoring configs attached to the feature group, or fetch by name or feature name only. If no arguments is provided the method will return all feature monitoring configs attached to the feature group, meaning all feature monitoring configs that are attach to a feature in the feature group. If you wish to fetch a single config, provide the its name. If you wish to fetch all configs attached to a particular feature, provide the feature name.
Example
# fetch your feature group
fg = fs.get_feature_group(name="my_feature_group", version=1)
# fetch all feature monitoring configs attached to the feature group
fm_configs = fg.get_feature_monitoring_configs()
# fetch a single feature monitoring config by name
fm_config = fg.get_feature_monitoring_configs(name="my_config")
# fetch all feature monitoring configs attached to a particular feature
fm_configs = fg.get_feature_monitoring_configs(feature_name="my_feature")
# fetch a single feature monitoring config with a given id
fm_config = fg.get_feature_monitoring_configs(config_id=1)
Arguments
- name
str | None
: If provided fetch only the feature monitoring config with the given name. Defaults to None. - feature_name
str | None
: If provided, fetch only configs attached to a particular feature. Defaults to None. - config_id
int | None
: If provided, fetch only the feature monitoring config with the given id. Defaults to None.
Raises
hsfs.client.exceptions.RestAPIError
. hsfs.client.exceptions.FeatureStoreException
. - ValueError: if both name and feature_name are provided. - TypeError: if name or feature_name are not string or None.
Return
Union[FeatureMonitoringConfig
, List[FeatureMonitoringConfig
], None] A list of feature monitoring configs. If name provided, returns either a single config or None if not found.
get_feature_monitoring_history#
SpineGroup.get_feature_monitoring_history(
config_name=None, config_id=None, start_time=None, end_time=None, with_statistics=True
)
Fetch feature monitoring history for a given feature monitoring config.
Example
# fetch your feature group
fg = fs.get_feature_group(name="my_feature_group", version=1)
# fetch feature monitoring history for a given feature monitoring config
fm_history = fg.get_feature_monitoring_history(
config_name="my_config",
start_time="2020-01-01",
)
# fetch feature monitoring history for a given feature monitoring config id
fm_history = fg.get_feature_monitoring_history(
config_id=1,
start_time=datetime.now() - timedelta(weeks=2),
end_time=datetime.now() - timedelta(weeks=1),
with_statistics=False,
)
Arguments
- config_name
str | None
: The name of the feature monitoring config to fetch history for. Defaults to None. - config_id
int | None
: The id of the feature monitoring config to fetch history for. Defaults to None. - start_time
str | int | datetime.datetime | datetime.date | None
: The start date of the feature monitoring history to fetch. Defaults to None. - end_time
str | int | datetime.datetime | datetime.date | None
: The end date of the feature monitoring history to fetch. Defaults to None. - with_statistics
bool | None
: Whether to include statistics in the feature monitoring history. Defaults to True. If False, only metadata about the monitoring will be fetched.
Raises
hsfs.client.exceptions.RestAPIError
. hsfs.client.exceptions.FeatureStoreException
. - ValueError: if both config_name and config_id are provided. - TypeError: if config_name or config_id are not respectively string, int or None.
Return
List[FeatureMonitoringResult
] A list of feature monitoring results containing the monitoring metadata as well as the computed statistics for the detection and reference window if requested.
get_fg_name#
SpineGroup.get_fg_name()
get_generated_feature_groups#
SpineGroup.get_generated_feature_groups()
Get the generated feature groups using this feature group, based on explicit provenance. These feature groups can be accessible or inaccessible. Explicit provenance does not track deleted generated feature group links, so deleted will always be empty. For inaccessible feature groups, only a minimal information is returned.
Returns
ProvenanceLinks
: Object containing the section of provenance graph requested.
Raises
hsfs.client.exceptions.RestAPIError
.
get_generated_feature_views#
SpineGroup.get_generated_feature_views()
Get the generated feature view using this feature group, based on explicit provenance. These feature views can be accessible or inaccessible. Explicit provenance does not track deleted generated feature view links, so deleted will always be empty. For inaccessible feature views, only a minimal information is returned.
Returns
ProvenanceLinks
: Object containing the section of provenance graph requested.
Raises
hsfs.client.exceptions.RestAPIError
.
get_parent_feature_groups#
SpineGroup.get_parent_feature_groups()
Get the parents of this feature group, based on explicit provenance. Parents are feature groups or external feature groups. These feature groups can be accessible, deleted or inaccessible. For deleted and inaccessible feature groups, only a minimal information is returned.
Returns
ProvenanceLinks
: Object containing the section of provenance graph requested.
Raises
hsfs.client.exceptions.RestAPIError
.
get_storage_connector#
SpineGroup.get_storage_connector()
Get the storage connector using this feature group, based on explicit provenance. Only the accessible storage connector is returned. For more items use the base method - get_storage_connector_provenance
Returns
`StorageConnector: Storage connector.
get_storage_connector_provenance#
SpineGroup.get_storage_connector_provenance()
Get the parents of this feature group, based on explicit provenance. Parents are storage connectors. These storage connector can be accessible, deleted or inaccessible. For deleted and inaccessible storage connector, only a minimal information is returned.
Returns
ExplicitProvenance.Links
: the storage connector used to generated this feature group
Raises
hsfs.client.exceptions.RestAPIError
.
get_tag#
SpineGroup.get_tag(name)
Get the tags of a feature group.
Example
# connect to the Feature Store
fs = ...
# get the Feature Group instance
fg = fs.get_or_create_feature_group(...)
fg_tag_value = fg.get_tag("example_tag")
Arguments
- name
str
: Name of the tag to get.
Returns
tag value
Raises
hsfs.client.exceptions.RestAPIError
in case the backend fails to retrieve the tag.
get_tags#
SpineGroup.get_tags()
Retrieves all tags attached to a feature group.
Returns
Dict[str, obj]
of tags.
Raises
hsfs.client.exceptions.RestAPIError
in case the backend fails to retrieve the tags.
json#
SpineGroup.json()
select#
SpineGroup.select(features)
Select a subset of features of the feature group and return a query object.
The query can be used to construct joins of feature groups or create a feature view with a subset of features of the feature group.
Example
# connect to the Feature Store
fs = ...
# get the Feature Group instance
from hsfs.feature import Feature
fg = fs.create_feature_group(
"fg",
features=[
Feature("id", type="string"),
Feature("ts", type="bigint"),
Feature("f1", type="date"),
Feature("f2", type="double")
],
primary_key=["id"],
event_time="ts")
# construct query
query = fg.select(["id", "f1"])
query.features
# [Feature('id', ...), Feature('f1', ...)]
Arguments
- features
List[str | hsfs.feature.Feature]
: A list ofFeature
objects or feature names as strings to be selected.
Returns
Query
: A query object with the selected features of the feature group.
select_all#
SpineGroup.select_all(include_primary_key=True, include_event_time=True)
Select all features in the feature group and return a query object.
The query can be used to construct joins of feature groups or create a feature view.
Example
# connect to the Feature Store
fs = ...
# get the Feature Group instances
fg1 = fs.get_or_create_feature_group(...)
fg2 = fs.get_or_create_feature_group(...)
# construct the query
query = fg1.select_all().join(fg2.select_all())
# show first 5 rows
query.show(5)
# select all features exclude primary key and event time
from hsfs.feature import Feature
fg = fs.create_feature_group(
"fg",
features=[
Feature("id", type="string"),
Feature("ts", type="bigint"),
Feature("f1", type="date"),
Feature("f2", type="double")
],
primary_key=["id"],
event_time="ts")
query = fg.select_all()
query.features
# [Feature('id', ...), Feature('ts', ...), Feature('f1', ...), Feature('f2', ...)]
query = fg.select_all(include_primary_key=False, include_event_time=False)
query.features
# [Feature('f1', ...), Feature('f2', ...)]
Arguments
- include_primary_key
bool | None
: If True, include primary key of the feature group to the feature list. Defaults to True. - include_event_time
bool | None
: If True, include event time of the feature group to the feature list. Defaults to True.
Returns
Query
. A query object with all features of the feature group.
select_except#
SpineGroup.select_except(features=None)
Select all features including primary key and event time feature of the feature group except provided features
and return a query object.
The query can be used to construct joins of feature groups or create a feature view with a subset of features of the feature group.
Example
# connect to the Feature Store
fs = ...
# get the Feature Group instance
from hsfs.feature import Feature
fg = fs.create_feature_group(
"fg",
features=[
Feature("id", type="string"),
Feature("ts", type="bigint"),
Feature("f1", type="date"),
Feature("f2", type="double")
],
primary_key=["id"],
event_time="ts")
# construct query
query = fg.select_except(["ts", "f1"])
query.features
# [Feature('id', ...), Feature('f1', ...)]
Arguments
- features
List[str | hsfs.feature.Feature] | None
: A list ofFeature
objects or feature names as strings to be excluded from the selection. Defaults to [], selecting all features.
Returns
Query
: A query object with the selected features of the feature group.
to_dict#
SpineGroup.to_dict()
update_deprecated#
SpineGroup.update_deprecated(deprecate=True)
Deprecate the feature group.
Example
# connect to the Feature Store
fs = ...
# get the Feature Group instance
fg = fs.get_or_create_feature_group(...)
fg.update_deprecated(deprecate=True)
Safe update
This method updates the feature group safely. In case of failure your local metadata object will be kept unchanged.
Arguments
- deprecate
bool
: Boolean value identifying if the feature group should be deprecated. Defaults to True.
Returns
FeatureGroup
. The updated feature group object.
update_description#
SpineGroup.update_description(description)
Update the description of the feature group.
Example
# connect to the Feature Store
fs = ...
# get the Feature Group instance
fg = fs.get_or_create_feature_group(...)
fg.update_description(description="Much better description.")
Safe update
This method updates the feature group description safely. In case of failure your local metadata object will keep the old description.
Arguments
- description
str
: New description string.
Returns
FeatureGroup
. The updated feature group object.
update_feature_description#
SpineGroup.update_feature_description(feature_name, description)
Update the description of a single feature in this feature group.
Example
# connect to the Feature Store
fs = ...
# get the Feature Group instance
fg = fs.get_or_create_feature_group(...)
fg.update_feature_description(feature_name="min_temp",
description="Much better feature description.")
Safe update
This method updates the feature description safely. In case of failure your local metadata object will keep the old description.
Arguments
- feature_name
str
: Name of the feature to be updated. - description
str
: New description string.
Returns
FeatureGroup
. The updated feature group object.
update_features#
SpineGroup.update_features(features)
Update metadata of features in this feature group.
Currently it's only supported to update the description of a feature.
Unsafe update
Note that if you use an existing Feature
object of the schema in the feature group metadata object, this might leave your metadata object in a corrupted state if the update fails.
Arguments
- features
hsfs.feature.Feature | List[hsfs.feature.Feature]
:Feature
or list of features. A feature object or list thereof to be updated.
Returns
FeatureGroup
. The updated feature group object.
update_notification_topic_name#
SpineGroup.update_notification_topic_name(notification_topic_name)
Update the notification topic name of the feature group.
Example
# connect to the Feature Store
fs = ...
# get the Feature Group instance
fg = fs.get_or_create_feature_group(...)
fg.update_notification_topic_name(notification_topic_name="notification_topic_name")
Safe update
This method updates the feature group notification topic name safely. In case of failure your local metadata object will keep the old notification topic name.
Arguments
- notification_topic_name
str
: Name of the topic used for sending notifications when entries are inserted or updated on the online feature store. If set to None no notifications are sent.
Returns
FeatureGroup
. The updated feature group object.