GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — feast/sdk/python/feast/cli/projects.py at master · feast-dev/feast Expand file tree/ Copy pathprojects.pyMore file actions 113 lines (98 loc) · 2.74 KB / Copy pathprojects.pyFile metadata and controls113 lines (98 loc) · 2.74 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 import click import yaml from feast import utils from feast.cli.cli_options import tagsOption from feast.errors import FeastObjectNotFoundException, ProjectNotFoundException from feast.repo_operations import create_feature_store @click.group(name="projects") def projects_cmd(): """ Access projects """ pass @projects_cmd.command("describe") @click.argument("name", type=click.STRING) @click.pass_context def project_describe(ctx: click.Context, name: str): """ Describe a project """ store = create_feature_store(ctx) try: project = store.get_project(name) except FeastObjectNotFoundException as e: print(e) exit(1) print( yaml.dump( yaml.safe_load(str(project)), default_flow_style=False, sort_keys=False, ) ) @projects_cmd.command("current_project") @click.pass_context def project_current(ctx: click.Context): """ Returns the current project configured with FeatureStore object """ store = create_feature_store(ctx) try: project = store.get_project(name=None) except FeastObjectNotFoundException as e: print(e) exit(1) print( yaml.dump( yaml.safe_load(str(project)), default_flow_style=False, sort_keys=False, ) ) @projects_cmd.command("delete") @click.argument("name", type=click.STRING) @click.option( "-y", "--yes", is_flag=True, default=False, help="Skip confirmation prompt and delete immediately.", ) @click.pass_context def project_delete(ctx: click.Context, name: str, yes: bool): """ Delete a project and all its resources from the registry. """ store = create_feature_store(ctx) if not yes: click.confirm( f"Are you sure you want to delete project '{name}'? " "This will remove all associated resources from the registry.", abort=True, ) try: store.delete_project(name) except (FeastObjectNotFoundException, ProjectNotFoundException) as e: print(str(e)) raise SystemExit(1) print(f"Project '{name}' deleted successfully.") @projects_cmd.command(name="list") @tagsOption @click.pass_context def project_list(ctx: click.Context, tags: list[str]): """ List all projects """ store = create_feature_store(ctx) table = [] tags_filter = utils.tags_list_to_dict(tags) for project in store.list_projects(tags=tags_filter): table.append([project.name, project.description, project.tags, project.owner]) from tabulate import tabulate print( tabulate( table, headers=["NAME", "DESCRIPTION", "TAGS", "OWNER"], tablefmt="plain", ) ) |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |