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

Function feature_view_disable

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

Disable a feature view to prevent serving and materialization.

(ctx: click.Context, name: str)

Source from the content-addressed store, hash-verified

124@click.argument("name", type=click.STRING)
125@click.pass_context
126def feature_view_disable(ctx: click.Context, name: str):
127 """
128 Disable a feature view to prevent serving and materialization.
129 """
130 store = create_feature_store(ctx)
131 try:
132 fv = store.registry.get_any_feature_view(name, store.project)
133 except FeastObjectNotFoundException as e:
134 print(e)
135 sys.exit(1)
136
137 if not isinstance(fv, (FeatureView, OnDemandFeatureView)):
138 print(f"Feature view '{name}' does not support enable/disable.")
139 return
140
141 if not fv.enabled:
142 print(f"Feature view '{name}' is already disabled.")
143 return
144
145 fv.enabled = False
146 store.registry.apply_feature_view(fv, store.project)
147 print(f"Feature view '{name}' has been disabled.")
148
149
150@feature_views_cmd.command("set-state")

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