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: 

Cannot write Feature Table because of invalid access token

mhansinger
New Contributor II

From a notebook I created a new feature store via:

%sql 
CREATE DATABASE IF NOT EXISTS feature_store_ebp;

Within that feature store I fill my table with:

feature_store_name = "feature_store_ebp.table_1"
try:
    fs.write_table(
        name=feature_store_name,
        df=training_data,
        mode="overwrite",
    )
except:
    fs.create_table(
        name=feature_store_name,
        keys=["ID"],
        features_df=training_data,
        partition_columns="MWNR",
        description="Table 1",
    )

I get then an ExceptionError:

Exception: API request to endpoint /api/2.0/feature-store/feature-tables/get failed with error code 403 != 200. Response body: '
 
 
Error 403 Invalid access token.
 
HTTP ERROR 403
 
Problem accessing /api/2.0/feature-store/feature-tables/get. Reason:
 
    Invalid access token.

What am I missing?

4 REPLIES 4

sher
Valued Contributor II

have you imported the module n create the connection ?

from databricks.feature_store import FeatureStoreClient

fs = FeatureStoreClient()

refer link: https://docs.databricks.com/machine-learning/feature-store/feature-tables.html#create-a-database-for...

Kaniz
Community Manager
Community Manager

Hi @Maximilian Hansinger​ , We haven’t heard from you since the last response from @sherbin w​, and I was checking back to see if his suggestions helped you.

Or else, If you have any solution, please share it with the community, as it can be helpful to others.

Also, Please don't forget to click on the "Select As Best" button whenever the information provided helps resolve your question.

mhansinger
New Contributor II

Hi @Kaniz Fatma​, 

unfortunately, that did not solve the problem.

Cami
Contributor III

What kind of runtime machine (version) do you use to run this code?

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!