MCPcopy Index your code
hub / github.com/feast-dev/feast / feature_view_enable

Function feature_view_enable

sdk/python/feast/cli/feature_views.py:99–120  ·  view source on GitHub ↗

Enable a feature view for serving and materialization.

(ctx: click.Context, name: str)

Source from the content-addressed store, hash-verified

97@click.argument("name", type=click.STRING)
98@click.pass_context
99def feature_view_enable(ctx: click.Context, name: str):
100 """
101 Enable a feature view for serving and materialization.
102 """
103 store = create_feature_store(ctx)
104 try:
105 fv = store.registry.get_any_feature_view(name, store.project)
106 except FeastObjectNotFoundException as e:
107 print(e)
108 sys.exit(1)
109
110 if not isinstance(fv, (FeatureView, OnDemandFeatureView)):
111 print(f"Feature view '{name}' does not support enable/disable.")
112 return
113
114 if fv.enabled:
115 print(f"Feature view '{name}' is already enabled.")
116 return
117
118 fv.enabled = True
119 store.registry.apply_feature_view(fv, store.project)
120 print(f"Feature view '{name}' has been enabled.")
121
122
123@feature_views_cmd.command("disable")

Callers

nothing calls this directly

Calls 3

create_feature_storeFunction · 0.90
get_any_feature_viewMethod · 0.45
apply_feature_viewMethod · 0.45

Tested by

no test coverage detected