Teradata Package for Python Function Reference | 20.00 - apply - 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 - 20.00
- Deployment
- VantageCloud
- VantageCore
- Edition
- VMware
- Enterprise
- IntelliFlex
- Product
- Teradata Package for Python
- Release Number
- 20.00.00.11
- Published
- August 2026
- ft:locale
- en-US
- ft:lastEdition
- 2026-08-13
- dita:id
- TeradataPython_FxRef_Enterprise_2000
- Product Category
- Teradata Vantage
- teradataml.store.feature_store.feature_store.FeatureStore.apply = apply(self, object, replace=False)
- DESCRIPTION:
Register objects to repository.
Note:
* If the object is an Entity or FeatureGroup and the same entity or feature group is already
registered in the repository, it is not updated.
* If the entity or feature group is associated with any feature process, an error is raised
while modifying these objects.
PARAMETERS:
object:
Required Argument.
Specifies the object to update the repository.
Types: Feature OR DataSource OR Entity OR FeatureGroup.
replace:
Optional Argument.
Specifies whether to update the existing object in the repository.
Default Value: False.
Types: bool.
RETURNS:
bool.
RAISES:
TeradataMLException
EXAMPLES:
>>> from teradataml import FeatureStore, DataFrame, load_example_data
# Create DataFrame on sales data.
>>> 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.
# Setup FeatureStore for this repository.
>>> fs.setup()
True
# Example 1: create a Feature for column 'Feb' from 'sales' DataFrame
# and register with repo 'vfs_v1'.
>>> # Create Feature.
>>> from teradataml import Feature
>>> feature = Feature('sales:Feb', df.Feb)
>>> # Register the above Feature with repo.
>>> fs.apply(feature)
True
>>>
# Example 2: create Entity for 'sales' DataFrame and register
# with repo 'vfs_v1'.
>>> # Create Entity.
>>> from teradataml import Entity
>>> entity = Entity('sales:accounts', df.accounts)
>>> # Register the above Entity with repo.
>>> fs.apply(entity)
True
>>>
# Example 3: create DataSource for 'sales' DataFrame and register
# with repo 'vfs_v1'.
>>> # Create DataSource.
>>> from teradataml import DataSource
>>> ds = DataSource('Sales_Data', df)
>>> # Register the above DataSource with repo.
>>> fs.apply(ds)
True
>>>
# Example 4: create FeatureStore with all the objects
# created in above examples and register with
# repo 'vfs_v1'.
>>> # Create FeatureGroup.
>>> from teradataml import FeatureGroup
>>> fg = FeatureGroup('Sales',
... features=feature,
... entity=entity,
... data_source=data_source)
>>> # Register the above FeatureStore with repo.
>>> fs.apply(fg)
True
# Example 5: Update the existing Feature in repo 'vfs_v1'.
>>> feature = Feature('sales:Feb', df.Feb, description="February sales")
>>> fs.apply(feature, replace=True)
True