Skip to content

BatchFeatureTable

A BatchFeatureTable object is a representation of a table in the feature store that contains feature values from batch serving. The object includes metadata on the Deployment and the BatchRequestTable used to create it.

Creating BatchFeatureTable Objects

A BatchFeatureTable Object is created by getting batch features from a Deployment object and a BatchRequestTable object.

To get batch features, follow those steps:

  1. Get a BatchRequestTable object from the catalog using the get_batch_request_table() method:

    batch_request_table = catalog.get_batch_request_table(<batch_request_table_name>)
    

  2. Get a Deployment object from the catalog using the [get_deployment()] method:

    deployment = catalog.get_deployment(<deployment_name>)
    

  3. Use the compute_batch_feature_table() method to retrieve batch features, passing in the BatchRequestTable object and optionally a desired name for the BatchFeatureTable:
    batch_features = deployment.compute_batch_feature_table(
        batch_request_table=batch_request_table,
        batch_feature_table_name = <batch_feature_table_name>
    )
    

You can then download or delete the BatchFeatureTable object using the download() or delete() methods. Deleting the object will delete the table in the feature store.

batch_features.download()
batch_features.delete()

You can convert the table to a Pandas DataFrame by using the to_pandas() method:

batch_features.to_pandas()

Getting BatchFeatureTable Lineage

The BatchFeatureTable object contains information on the Deployment and BatchRequestTable used to create it which can be accessed using the deployment_id and batch_request_table_id properties. This returns the Object IDs of the two objects.

batch_features.deployment_id
batch_features.batch_request_table_id

Listing and Retrieving BatchFeatureTable Objects

To list the BatchFeatureTable objects in the catalog, use the list_batch_feature_tables() method:

catalog.list_batch_feature_tables()

To retrieve a specific BatchFeatureTable by its name from the catalog, use the get_batch_feature_table() method:

batch_features = catalog.get_batch_feature_table(<batch_feature_table_name>)

To retrieve a specific BatchFeatureTable by its Object ID from the catalog, use the get_batch_feature_table_by_id() method:

batch_features = catalog.get_batch_feature_table_by_id(<batch_feature_table_id>)