Teradata Package for Python Function Reference on VantageCloud Lake - run - Teradata Package for Python - Look here for syntax, methods and examples for the functions included in the Teradata Package for Python.

Teradata® Package for Python Function Reference on VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Package for Python
Release Number
20.00.00.08
Published
November 2025
ft:locale
en-US
ft:lastEdition
2025-12-05
dita:id
TeradataPython_FxRef_Lake_2000
Product Category
Teradata Vantage
teradataml.store.feature_store.models.FeatureProcess.run = run(self, filters=None, as_of=None)
DESCRIPTION:
    Runs the feature process.
 
PARAMETERS:
    filters:
        Optional Argument.
        Specifies filters to be applied on data source while ingesting
        feature values for FeatureProcess.
        Types: str or list of str or ColumnExpression or list of ColumnExpression.
 
    as_of:
        Optional Argument.
        Specifies the time period for which feature values are ingested.
        Note:
            * If "as_of" is specified as either string or datetime.datetime,
              then specified value is considered as starting time period and
              ending time period is considered as '31-DEC-9999 23:59:59.999999+00:00'.
        Types: str or datetime.datetime or tuple
 
RETURNS:
    bool.
 
RAISES:
    TeradataMlException
 
EXAMPLES:
    >>> load_example_data('dataframe', ['sales'])
    >>> df = DataFrame("sales")
 
    # Create a FeatureStore.
    >>> from teradataml import FeatureStore
    >>> fs = FeatureStore("vfs_test", data_domain='sales')
    Repo vfs_v1 does not exist. Run FeatureStore.setup() to create the repo and setup FeatureStore.
    >>> fs.setup()
    True
 
    # Example 1: Ingest the feature values using DataFrame 'df' to the repo "vfs_test".
    # Create FeatureProcess using DataFrame as source.
    >>> fp = FeatureProcess(repo="vfs_test",
    ...                     data_domain='sales',
    ...                     object=df,
    ...                     entity="accounts",
    ...                     features=["Jan", "Feb", "Mar", "Apr"])
    >>> fp.run()
    Process '76049397-6b8e-11f0-b77a-f020ffe7fe09' started.
    Process '76049397-6b8e-11f0-b77a-f020ffe7fe09' completed.
    True
    
    # Verify the FeatureProcess was recorded
    >>> fs.list_feature_processes()
                                         description data_domain       process_type  data_source    entity_id       feature_names feature_ids                     valid_start                       valid_end
    process_id                                                                                                                                                                                               
    a5de0230-6b8e-11f0-ae70-f020ffe7fe09                   sales      feature group  sales_group  sales_group  Apr, Feb, Jan, Mar        None  2025-07-28 08:41:42.460000+00:  9999-12-31 23:59:59.999999+00:
    76049397-6b8e-11f0-b77a-f020ffe7fe09                   sales  denormalized view      "sales"     accounts  Apr, Feb, Jan, Mar        None  2025-07-28 08:40:17.600000+00:  9999-12-31 23:59:59.999999+00:
 
    # Example 2: Ingest the feature values using feature group to the repo "vfs_test".
    #            Create FeatureGroup from DataFrame and use it as source for FeatureProcess.
    >>> from teradataml import FeatureGroup
    >>> fg = FeatureGroup.from_DataFrame(name="sales_group", 
    ...                                  entity_columns="accounts", 
    ...                                  df=df,
    ...                                  timestamp_column="datetime")
    >>> fs.apply(fg)
    True
    
    # Create FeatureProcess using FeatureGroup as source
    >>> fp = FeatureProcess(repo="vfs_test", 
    ...                     data_domain='sales',
    ...                     object=fg)
    >>> fp.run()
    Process 'b2c3d4e5-2345-11f0-8765-f020ffe7fe09' started.
    Process 'b2c3d4e5-2345-11f0-8765-f020ffe7fe09' completed.
    True
    
    # Verify the process was recorded
    >>> fs.list_feature_processes()
                                         description data_domain       process_type  data_source    entity_id       feature_names feature_ids                     valid_start                       valid_end
    process_id                                                                                                                                                                                               
    a5de0230-6b8e-11f0-ae70-f020ffe7fe09                   sales      feature group  sales_group  sales_group  Apr, Feb, Jan, Mar        None  2025-07-28 08:41:42.460000+00:  9999-12-31 23:59:59.999999+00:
    76049397-6b8e-11f0-b77a-f020ffe7fe09                   sales  denormalized view      "sales"     accounts  Apr, Feb, Jan, Mar        None  2025-07-28 08:40:17.600000+00:  9999-12-31 23:59:59.999999+00:
 
 
    # Example 3: Ingest the feature values using process id to the repo "vfs_test".
    #            Rerun an existing feature process using its process_id.
    # Create FeatureProcess using existing process_id as source
    >>> fp_rerun = FeatureProcess(repo="vfs_test", 
    ...                           data_domain='sales',
    ...                           object=fp.process_id,
    ...                           description="Rerun existing process")
    >>> fp_rerun.run()
    Process 'b2c3d4e5-2345-11f0-8765-f020ffe7fe09' started.
    Process 'b2c3d4e5-2345-11f0-8765-f020ffe7fe09' completed.
    True
    
    # Verify the process runs
    >>> fs.list_feature_processes()
                                                     description data_domain       process_type  data_source    entity_id       feature_names feature_ids                     valid_start                       valid_end
    process_id                                                                                                                                                                                                           
    a5de0230-6b8e-11f0-ae70-f020ffe7fe09                               sales      feature group  sales_group  sales_group  Apr, Feb, Jan, Mar        None  2025-07-28 08:41:42.460000+00:  9999-12-31 23:59:59.999999+00:
    76049397-6b8e-11f0-b77a-f020ffe7fe09                               sales  denormalized view      "sales"     accounts  Apr, Feb, Jan, Mar        None  2025-07-28 08:40:17.600000+00:  2025-07-28 08:44:52.220000+00:
    76049397-6b8e-11f0-b77a-f020ffe7fe09  Rerun existing process       sales  denormalized view      "sales"     accounts  Apr, Feb, Jan, Mar        None  2025-07-28 08:44:52.220000+00:  9999-12-31 23:59:59.999999+00:
 
    # 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.
    >>> 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
 
    # Let's 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
 
    # Example 5: Ingest feature values for a specific time using DataFrame as source.
    >>> from datetime import datetime, timezone
    >>> fp = FeatureProcess(repo="vfs_test",
    ...                     data_domain='sales',
    ...                     object=df,
    ...                     entity='accounts',
    ...                     features=['Jan', 'Feb'])
    >>> fp.run(as_of='2024-01-01 00:00:00+00:00')
    Process '2a5d5eee-738e-11f0-99c5-a30631e77953' started.
    Process '2a5d5eee-738e-11f0-99c5-a30631e77953' completed.
    True
 
    # Example 6: Ingest feature values for a specific time using feature group as source.
    >>> fg = FeatureGroup.from_DataFrame(name="sales_temporal",
    ...                                  entity_columns="accounts",
    ...                                  df=df)
    >>> fp = FeatureProcess(repo="vfs_test",
    ...                     data_domain='sales',
    ...                     object=fg)
    >>> fp.run(as_of='2024-01-01 00:00:00+00:00')
    Process '6e5a8da0-738f-11f0-99c5-a30631e77953' started.
    Process '6e5a8da0-738f-11f0-99c5-a30631e77953' completed.
    True