cancel
Showing results for 
Search instead for 
Did you mean: 
Machine Learning
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

13 REPLIES 13

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 @Hubert Dudek​ , Here's the link to the documentation to delete the feature tables. Please let me know if this helps.

image

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

Hi @Gabriele Muciaccia​ and @Hubert Dudek​ , Thank you for the clarification. I'll try to find the solution to your question and get back to you very soon.

Atanu
Esteemed Contributor
Esteemed Contributor

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.

Hi @Gabriele Muciaccia​ , Just a friendly follow-up. Do you still need help, or @Atanu Sarkar​  's response help you to find the solution? Please let us know.

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

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.