delete_feature_group() | FeatureStore Delete Method | Teradata Package for Python - delete_feature_group() - Teradata Package for Python

Teradata® Package for Python User Guide

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Teradata Package for Python
Release Number
20.00
Published
March 2025
ft:locale
en-US
ft:lastEdition
2025-12-05
dita:mapPath
nvi1706202040305.ditamap
dita:ditavalPath
plt1683835213376.ditaval
dita:id
rkb1531260709148
Product Category
Teradata Vantage

Use the delete_feature_group() method to remove the archived feature group from the repository.

Unlike archive_feature_group(), this function does not delete the associated features, entity, and data source. Use delete_feature(), delete_entity() and delete_data_source() to delete the relevant FeatureStore component.

Required Parameter

feature_group
Specifies either the name of the feature group or object of the feature group to remove from the repository.

Example setup

>>> from teradataml import DataFrame, FeatureGroup, FeatureStore

Create teradataml DataFrame.

>>> load_example_data('dataframe', ['sales'])
>>> df = DataFrame("sales")

Create FeatureStore for repo 'vfs_v1'.

>>> fs = FeatureStore("vfs_v1", data_domain="d1")
Repo vfs_v1 does not exist. Run FeatureStore.setup() to create the repo and setup FeatureStore.

Set up the feature store for this repository.

>>> fs.setup()
True

Example 1: Delete the FeatureGroup 'sales' in the repo 'vfs_v1' using FeatureGroup name

Create FeatureGroup from teradataml DataFrame.

>>> fg = FeatureGroup.from_DataFrame(name="sales", entity_columns="accounts", df=df, timestamp_column="datetime")

Apply FeatureGroup to FeatureStore.

>>> fs.apply(fg)
True

List all the available FeatureGroups.

>>> fs.list_feature_groups()
                  description data_source_name entity_name               creation_time modified_time
name  data_domain                                                                                  
sales d1                 None            sales       sales  2025-07-28 05:00:19.780453          None

Archive FeatureGroup with name "sales".

>>> fs.archive_feature_group(feature_group='sales')
FeatureGroup 'sales' is archived.
True

Delete FeatureGroup with name "sales".

>>> fs.delete_feature_group(feature_group='sales')
FeatureGroup 'sales' is deleted.
True

List all the available FeatureGroups after delete.

>>> fs.list_feature_groups()
Empty DataFrame
Columns: [description, data_source_name, entity_name, creation_time, modified_time]
Index: []

Example 2: Delete the FeatureGroup 'sales' in the repo 'vfs_v1' using FeatureGroup object

Create FeatureGroup from teradataml DataFrame.

>>> fg2 = FeatureGroup.from_DataFrame(name="sales", entity_columns="accounts", df=df, timestamp_column="datetime")

Apply FeatureGroup to FeatureStore.

>>> fs.apply(fg2)
True

Archive FeatureGroup with FeatureGroup object.

>>> fs.archive_feature_group(feature_group=fg2)
FeatureGroup 'sales' is archived.
True

Delete FeatureGroup with FeatureGroup object.

>>> fs.delete_feature_group(feature_group=fg2)
FeatureGroup 'sales' is deleted.
True