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

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.