Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"feast apply" does not register a new BatchFeatureView #3082

Closed
sfc-gh-madkins opened this issue Aug 15, 2022 · 1 comment · Fixed by #3092 or #3098
Closed

"feast apply" does not register a new BatchFeatureView #3082

sfc-gh-madkins opened this issue Aug 15, 2022 · 1 comment · Fixed by #3092 or #3098
Assignees
Labels

Comments

@sfc-gh-madkins
Copy link
Collaborator

sfc-gh-madkins commented Aug 15, 2022

Expected Behavior

Same behavior as regular FeatureViews

Current Behavior

Take following sample .py file and run cmd "feast apply" -- works just fine for regular FeatureViews

Steps to reproduce

from datetime import timedelta

import yaml

from feast import BatchFeatureView, Entity, FeatureService, SnowflakeSource

driver = Entity(
    # Name of the entity. Must be unique within a project
    name="driver",
    # The join keys of an entity describe the storage level field/column on which
    # features can be looked up. The join keys are also used to join feature
    # tables/views when building feature vectors
    join_keys=["driver_id"],
)

project_name = yaml.safe_load(open("feature_store.yaml"))["project"]

driver_stats_source = SnowflakeSource(
    database=yaml.safe_load(open("feature_store.yaml"))["offline_store"]["database"],
    table=f"{project_name}_feast_driver_hourly_stats",
    timestamp_field="event_timestamp",
    created_timestamp_column="created",
)

driver_stats_fv = BatchFeatureView(
    name="driver_hourly_stats",
    entities=[driver],
    ttl=timedelta(weeks=52),
    source=driver_stats_source,
)

driver_stats_fs = FeatureService(name="driver_activity", features=[driver_stats_fv])

Specifications

  • Version:
  • Platform:
  • Subsystem:

Possible Solution

@sfc-gh-madkins
Copy link
Collaborator Author

sfc-gh-madkins commented Aug 17, 2022

@achals when register the feature view through feast.apply() I am still getting errors:

Traceback (most recent call last): File "test.py", line 66, in <module> main() File "test.py", line 41, in main training_df = fs.get_historical_features( File "/Users/madkins/Documents/feast/sdk/python/feast/usage.py", line 294, in wrapper raise exc.with_traceback(traceback) File "/Users/madkins/Documents/feast/sdk/python/feast/usage.py", line 283, in wrapper return func(*args, **kwargs) File "/Users/madkins/Documents/feast/sdk/python/feast/feature_store.py", line 1092, in get_historical_features fvs, odfvs, request_fvs, request_fv_refs = _group_feature_refs( File "/Users/madkins/Documents/feast/sdk/python/feast/feature_store.py", line 2553, in _group_feature_refs raise FeatureViewNotFoundException(view_name) feast.errors.FeatureViewNotFoundException: Feature view driver_hourly_stats does not exist

driver_stats_fv = BatchFeatureView( # The unique name of this feature view. Two feature views in a single # project cannot have the same name name="driver_hourly_stats", # The list of entities specifies the keys required for joining or looking # up features from this feature view. The reference provided in this field # correspond to the name of a defined entity (or entities) entities=[driver], # The timedelta is the maximum age that each feature value may have # relative to its lookup time. For historical features (used in training), # TTL is relative to each timestamp provided in the entity dataframe. # TTL also allows for eviction of keys from online stores and limits the # amount of historical scanning required for historical feature values # during retrieval ttl=timedelta(weeks=52), # Batch sources are used to find feature values. In the case of this feature # view we will query a source table on Redshift for driver statistics # features source=driver_stats_source, )

feast.apply(fs.apply([driver, driver_stats_fv])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants