delete_feature() | FeatureStore Delete Method | Teradata Package for Python - delete_feature() - 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() method to remove the archived feature from repository.

One feature can be ingested by multiple processes. If the feature associated with process "process_id" is also ingested by other processes, then the "delete_feature_process()" function only deletes the feature values associated with the process "process_id". Else it deletes the feature from the feature catalog. Refer to FeatureCatalog.delete_features() for more details.

Required Parameter

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

Example setup

>>> from teradataml import DataFrame, Feature, FeatureStore

Create a teradataml DataFrame.

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

Create FeatureStore for repo 'vfs_v1'.

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

Set up FeatureStore for this repository.

>>> fs.setup()
True

Example 1: Delete the Feature 'sales_data_Feb' in the repo 'vfs_v1' using Feature object

Create Feature for Column 'Feb'.

>>> feature = Feature(name="sales_data_Feb", column=df.Feb)

Add the feature created above in the feature store.

>>> fs.apply(feature)
True

List the available features.

>>> fs.list_features()
                            id column_name description  tags data_type feature_type  status               creation_time modified_time group_name
name           data_domain                                                                                                                      
sales_data_Feb ALICE         1         Feb        None  None     FLOAT   CONTINUOUS  ACTIVE  2025-07-28 04:49:55.827391          None       None

Archive the feature.

>>> fs.archive_feature(feature=feature)
Feature 'sales_data_Feb' is archived.
True

Delete Feature with name "sales_data_Feb".

>>> fs.delete_feature(feature=feature)
Feature 'sales_data_Feb' is deleted.
True

List the available Features after delete.

>>> fs.list_features()
Empty DataFrame
Columns: [id, column_name, description, tags, data_type, feature_type, status, creation_time, modified_time, group_name]
Index: []

Example 2: Delete the Feature 'sales_data_Feb' in the repo 'vfs_v1' using feature name

Create Feature for Column 'Jan'.

>>> feature2 = Feature(name="sales_data_Jan", column=df.Jan)

Add the feature created above in the feature store.

>>> fs.apply(feature2)
True

List the available features.

>>> fs.list_features()
                            id column_name description  tags data_type feature_type  status               creation_time modified_time group_name
name           data_domain
sales_data_Jan ALICE         2         Jan        None  None     FLOAT   CONTINUOUS  ACTIVE  2025-07-28 04:50:55.827391          None       None

Archive the Feature using feature name.

>>> fs.archive_feature(feature="sales_data_Jan")
Feature 'sales_data_Jan' is archived.
True

Delete Feature with name "sales_data_Jan".

>>> fs.delete_feature(feature="sales_data_Jan")
Feature 'sales_data_Jan' is deleted.
True