Enable a feature view for serving and materialization.
(ctx: click.Context, name: str)
| 97 | @click.argument("name", type=click.STRING) |
| 98 | @click.pass_context |
| 99 | def 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") |
nothing calls this directly
no test coverage detected