delete_features() | FeatureCatalog Method | Teradata Package for Python - delete_features() - 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_features() method to delete the archived feature values from the feature catalog.

After deleting the feature values from the feature catalog table, the function also drops the feature table from the repository if the feature table is not used by any other feature.

Required Parameter

features
Specifies names of the features to be deleted from the feature catalog.

Example setup

Create the feature store repository 'vfs_v1'.

>>> from teradataml import FeatureStore
>>> fs = FeatureStore(repo='vfs_v1', data_domain='sales')
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

Load example data.

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

Create an instance of FeatureCatalog.

>>> fc = FeatureCatalog(repo='vfs_v1', data_domain='sales')

Upload features from the DataFrame.

>>> fp = fc.upload_features(object=df,
...                         entity=["accounts"],
...                         features=["Feb", "Jan", "Mar", "Apr"])
Process '01c70f05-4067-11f0-9e8a-fb57338c2e68' started.
Process '01c70f05-4067-11f0-9e8a-fb57338c2e68' completed.

List the features.

>>> fc.list_features()
            feature_id name data_type feature_type                      valid_start                        valid_end
entity_name
accounts              1  Feb     FLOAT   CONTINUOUS  2025-06-12 05:28:42.916821+00:  9999-12-31 23:59:59.999999+00:
accounts              4  Apr    BIGINT   CONTINUOUS  2025-06-12 05:28:42.916821+00:  9999-12-31 23:59:59.999999+00:
accounts              3  Mar    BIGINT   CONTINUOUS  2025-06-12 05:28:42.916821+00:  9999-12-31 23:59:59.999999+00:
accounts              2  Jan    BIGINT   CONTINUOUS  2025-06-12 05:28:42.916821+00:  9999-12-31 23:59:59.999999+00:

Example 1: Delete the single feature value from feature catalog

Archive the feature values.

>>> fc.archive_features(features='Apr')
True
>>> fc.delete_features(features='Apr')
True

Validate the feature is deleted.

>>> fc.list_features()
            feature_id name data_type feature_type                      valid_start                        valid_end
entity_name                                                                                                       
accounts              3  Mar    BIGINT   CONTINUOUS  2025-06-17 15:17:25.057869+00:  9999-12-31 23:59:59.999999+00:
accounts              2  Jan    BIGINT   CONTINUOUS  2025-06-17 15:17:25.057869+00:  2025-06-17 15:27:59.360000+00:
accounts              1  Feb     FLOAT   CONTINUOUS  2025-06-17 15:17:25.057869+00:  2025-06-17 15:27:59.360000+00:

Example 2: Delete multiple feature values from feature catalog

>>> fc.archive_features(features=['Jan', 'Feb'])
True
>>> fc.delete_features(features=['Jan', 'Feb'])
True

Validate the feature values are deleted.

>>> fc.list_features()
             feature_id name data_type feature_type                     valid_start                       valid_end
entity_name                                                                                                       
accounts              3  Mar    BIGINT   CONTINUOUS  2025-06-17 15:17:25.057869+00:  9999-12-31 23:59:59.999999+00: