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?

3 REPLIES 3

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...

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?

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