Teradata Package for Python Function Reference | 20.00 - list_entities - 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
- Enterprise
- IntelliFlex
- VMware
- Product
- Teradata Package for Python
- Release Number
- 20.00.00.03
- Published
- December 2024
- ft:locale
- en-US
- ft:lastEdition
- 2024-12-19
- dita:id
- TeradataPython_FxRef_Enterprise_2000
- lifecycle
- latest
- Product Category
- Teradata Vantage
- teradataml.store.feature_store.feature_store.FeatureStore.list_entities = list_entities(self, archived=False) -> teradataml.dataframe.dataframe.DataFrame
- DESCRIPTION:
List all the entities.
PARAMETERS:
archived
Optional Argument
Specifies whether to list effective entities or archived entities.
When set to False, effective entities in FeatureStore are listed,
otherwise, archived entities are listed.
Default Value: False
Types: bool
RETURNS:
teradataml DataFrame
RAISES:
None
EXAMPLES:
>>> from teradataml import DataFrame, FeatureStore, load_example_data
>>> load_example_data('dataframe', 'sales')
# Create FeatureStore for repo 'vfs_v1'.
>>> fs = FeatureStore("vfs_v1")
# Create teradataml DataFrame.
>>> df = DataFrame("sales")
# Create a FeatureGroup from teradataml DataFrame.
>>> fg = FeatureGroup.from_DataFrame(name='sales',
... entity_columns='accounts',
... df=df,
... timestamp_col_name='datetime')
# Apply the FeatureGroup to FeatureStore.
>>> fs.apply(fg)
True
# Example 1: List all the effective Entities in the repo 'vfs_v1'.
>>> fs.list_entities()
description
name entity_column
sales accounts None
>>>
# Example 2: List all the archived Entities in the repo 'vfs_v1'.
# Note: Entity cannot be archived if it is a part of FeatureGroup.
# First create another Entity, and update FeatureGroup with
# other Entity. Then archive Entity 'sales'.
>>> entity = Entity('store_sales', columns=df.accounts)
# Update new entity to FeatureGroup.
>>> fg.apply(entity)
# Update FeatureGroup to FeatureStore. This will update Entity
# from 'sales' to 'store_sales' for FeatureGroup 'sales'.
>>> fs.apply(fg)
True
# Let's archive Entity 'sales' since it is not part of any FeatureGroup.
>>> fs.archive_entity('sales')
Entity 'sales' is archived.
True
>>>
# List the archived entities.
>>> fs.list_entities(archived=True)
name description creation_time modified_time archived_time entity_column
0 sales None 2024-10-18 05:41:36.932856 None 2024-10-18 05:50:00.930000 accounts
>>>