How to delete Databricks feature tables through the Python API

1.1k views Asked by At

The documentation explains how to delete feature tables through the UI.

Is it possible to do the same using the Python FeatureStoreClient? I cannot find anything in the docs: https://docs.databricks.com/_static/documents/feature-store-python-api-reference-0-3-7.pdf

Use case: we use ephemeral dev environments for development and we have automated deletion of resources when the environment is torn down. Now we are considering using the feature store, but we don't know how to automate deletion.

2

There are 2 answers

2
ArcTeryxOverAlteryx On

The answer above is correct, but note that the drop_table() function is experimental according to databricks documentation for the Feature Store Client API so it could be removed at any time. Besides that fs is also in reference to:

from databricks.feature_store import FeatureStoreClient
fs = FeatureStoreClient()

fs.drop_table(name='recommender_system.customer_features')
1
Priyanka Jhaan On

You can delete a feature table using the Feature Store Python API.
It is described here: http://docs.databricks.com.s3-website-us-west-1.amazonaws.com/applications/machine-learning/feature-store/feature-tables.html#delete-a-feature-table

Use drop_table to delete a feature table. When you delete a table with drop_table, the underlying Delta table is also dropped.

fs.drop_table(
  name='recommender_system.customer_features'
)