feast-dev / feast-gcp-driver-ranking-tutorial

Feast GCP tutorial using BigQuery / Datastore to train / serve a driver ranking model
10 stars 18 forks source link

Correct offline_store config to enable BigQuerySources #5

Closed vinhloc30796 closed 3 years ago

vinhloc30796 commented 3 years ago

If not changed, then this error occurs:

$ poetry run python train.py
Traceback (most recent call last):
  File "~\feast-driver-ranking-tutorial\train.py", line 14, in <module>
    training_df = fs.get_historical_features(
  File "[...]\feast\infra\offline_stores\file.py", line 41, in to_df
    df = self.evaluation_function()
  File "[...]\feast\infra\offline_stores\file.py", line 115, in evaluate_historical_retrieval
    table = pyarrow.parquet.read_table(feature_view.batch_source.path)
AttributeError: 'BigQuerySource' object has no attribute 'path'

The error occurs because, when left undefined, FeatureStore.config.offline_store defaults to FileOfflineStoreConfig(type='file') - which is incorrect.

More specifically, in train.py:

# Connect to your local feature store
fs = feast.FeatureStore(repo_path="driver_ranking/")

# Check FeatureStore.config
fs.config.offline_store # should return FileOfflineStoreConfig(type='file')