Disable a feature view to prevent serving and materialization.
(ctx: click.Context, name: str)
| 124 | @click.argument("name", type=click.STRING) |
| 125 | @click.pass_context |
| 126 | def 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") |
nothing calls this directly
no test coverage detected