cancel
Showing results for 
Search instead for 
Did you mean: 
Machine Learning
Dive into the world of machine learning on the Databricks platform. Explore discussions on algorithms, model training, deployment, and more. Connect with ML enthusiasts and experts.
cancel
Showing results for 
Search instead for 
Did you mean: 

Delete feature tables through the Python API

GabrieleMuciacc
New Contributor III

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

Partially related: is it possible to manage control access through Python APIs too?

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.

1 ACCEPTED SOLUTION

Accepted Solutions

User16788316720
New Contributor III
from databricks import feature_store
fs = feature_store.FeatureStoreClient() 
fs.drop_table(FEATURE_TABLE_NAME)

As of Databricks Runtime 10.5 for ML. Docs

View solution in original post

10 REPLIES 10

Hubert-Dudek
Esteemed Contributor III

You can try to delete that table through metastore:

%sql DROP TABLE IF EXISTS <feature_table_name>

GabrieleMuciacc
New Contributor III

Thanks @Hubert Dudek​ for the answer. However, this only deletes the underlying Delta table, not the feature table in the store: you end up in an inconsistent state where you cannot write/read and you cannot re-create the table.

Hubert-Dudek
Esteemed Contributor III

@Kaniz Fatma​ @Piper Wilson​  maybe someone from Databricks team could check is there any API command or API endpoint or SQL command or to delete feature tables? I couldn't find any and workaround which I proposed create inconsistent state.

Hi @Kaniz Fatma​ , unfortunately this is the same link I included in my question and it does not help. I was asking about doing it programmatically.

Hubert-Dudek
Esteemed Contributor III

@Kaniz Fatma​ no this is through UI, request is how to do it programatically

Atanu
Databricks Employee
Databricks Employee

I am not 100% familar with this but does this relates to feature store. if yes, API works it seems https://docs.databricks.com/applications/machine-learning/feature-store/python-api.html. Please let me know if this help @Gabriele Muciaccia​  Thanks.

Thanks, I see it has been added as an experimental method in version 0.4.1 (Databricks Runtime 10.5 for ML).

There is still no way to control access though, hopefully that will be added too.

I have selected as best, but @Atanu Sarkar​ could you please edit your answer to include feature store and Databricks Runtime versions? Thanks!

SonghuaZhang
New Contributor II

Setting permission to feature table programmatically will be much helpful. Another API I think that will be useful is the search function. and even better, if we can have a databricks (restful) API endpoint for feature store.

User16788316720
New Contributor III
from databricks import feature_store
fs = feature_store.FeatureStoreClient() 
fs.drop_table(FEATURE_TABLE_NAME)

As of Databricks Runtime 10.5 for ML. Docs

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group