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?

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?