archive_feature_group() | FeatureStore Archive Method | Teradata Package for Python - archive_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 archive_feature_group() method to archive a feature group from the repository.

  • An archived feature group is not available for any further processing.
  • An archived feature group can be viewed using the list_feature_groups(archived=True) method.

This function archives the associated features, entity, and data sources if they are not associated with any other feature groups.

Required Parameter

feature_group
Specifies either the name of the feature group or object of the feature group to archive 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 FeatureStore for this repository.

>>> fs.setup()
True

Example 1: Archive 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

List all the available FeatureGroups after archive.

>>> fs.list_feature_groups(archived=True)
    name data_domain description data_source_name entity_name               creation_time modified_time               archived_time
0  sales          d1        None            sales       sales  2025-07-28 05:00:19.780453          None  2025-07-28 05:02:04.100000

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

Create FeatureGroup from teradataml DataFrame.

>>> fg2 = FeatureGroup.from_DataFrame(name="sales_df", 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_df' is archived.
True

List all the available FeatureGroups after archive.

>>> fs.list_feature_groups(archived=True)
    name data_domain description data_source_name entity_name               creation_time modified_time               archived_time
0  sales          d1        None            sales       sales  2025-07-28 05:00:19.780453          None  2025-07-28 05:02:04.100000
1  sales_df       d1        None            sales       sales  2025-07-28 05:02:01.123456          None  2025-07-28 05:03:35.456789