def feature_view_list(ctx: click.Context): """ List all feature views """ repo = ctx.obj["CHDIR"] cli_check_repo(repo) store = FeatureStore(repo_path=str(repo)) table = [] for feature_view in [ *store.list_feature_views(), *store.list_request_feature_views(), *store.list_on_demand_feature_views(), ]: entities = set() if isinstance(feature_view, FeatureView): entities.update(feature_view.entities) elif isinstance(feature_view, OnDemandFeatureView): for backing_fv in feature_view.inputs.values(): if isinstance(backing_fv, FeatureView): entities.update(backing_fv.entities) table.append([ feature_view.name, entities if len(entities) > 0 else "n/a", type(feature_view).__name__, ]) from tabulate import tabulate print( tabulate(table, headers=["NAME", "ENTITIES", "TYPE"], tablefmt="plain"))
def on_demand_feature_view_list(ctx: click.Context): """ [Experimental] List all on demand feature views """ repo = ctx.obj["CHDIR"] cli_check_repo(repo) store = FeatureStore(repo_path=str(repo)) table = [] for on_demand_feature_view in store.list_on_demand_feature_views(): table.append([on_demand_feature_view.name]) from tabulate import tabulate print(tabulate(table, headers=["NAME"], tablefmt="plain"))