Example 4: Ingest the sales features 'Mar' and 'Apr' for entities 'Alpha Co' and 'Jones LLC' to the 'sales' data domain. Use 'accounts' column as entity - 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

Example setup

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

Create a feature store.

>>> from teradataml import FeatureStore
>>> fs = FeatureStore("vfs_test", data_domain='sales')
Repo vfs_test does not exist. Run FeatureStore.setup() to create the repo and setup FeatureStore.
>>> fs.setup()
True

Create the feature process and run it with filters

>>> fp = FeatureProcess(repo="vfs_test",
...                     data_domain='sales',
...                     object=df,
...                     entity='accounts',
...                     features=['Mar', 'Apr'])
>>> fp.run(filters=[df.accounts=='Alpha Co', "accounts='Jones LLC'"])
Process '2a5d5eee-738e-11f0-99c5-a30631e77953' started.
Ingesting the features for filter 'accounts = 'Alpha Co'' to catalog.
Ingesting the features for filter 'accounts='Jones LLC'' to catalog.
Process '2a5d5eee-738e-11f0-99c5-a30631e77953' completed.
True

Verify the ingested feature values

>>> fs.list_feature_catalogs()
            data_domain  feature_id                                 table_name                     valid_start                       valid_end
entity_name
accounts          sales           1  FS_T_a38baff6_821b_3bb7_0850_827fe5372e31  2025-08-07 12:58:41.250000+00:  9999-12-31 23:59:59.999999+00:
accounts          sales           2  FS_T_a38baff6_821b_3bb7_0850_827fe5372e31  2025-08-07 12:58:41.250000+00:  9999-12-31 23:59:59.999999+00:

Verify the feature data

>>> dc = DatasetCatalog(repo='vfs_test', data_domain='sales')
>>> dc.build_dataset(entity='accounts',
...                  selected_features={'Mar': fp.process_id,
...                                     'Apr': fp.process_id},
...                  view_name='sales_mar_data')
            Mar Apr
accounts
Jones LLC   140 180
Alpha Co    215 250