Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: Add project delete command to CLI
Expose project deletion via `feast projects delete <name>` CLI command.
The registry already supports deleting projects programmatically, but
there was no CLI command for it.

- Add `delete_project` method to `FeatureStore`
- Add `feast projects delete` CLI command with confirmation prompt
- Support `--yes/-y` flag to skip confirmation

Fixes #5095

Signed-off-by: majianhan <majianhan@kylinos.cn>
  • Loading branch information
majianhan committed Apr 1, 2026
commit 4955c1d629e56639fb847e403ed73e025e5158a0
32 changes: 32 additions & 0 deletions sdk/python/feast/cli/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,38 @@ def project_current(ctx: click.Context):
)


@projects_cmd.command("delete")
@click.argument("name", type=click.STRING)
@click.option(
"--yes",
"-y",
is_flag=True,
default=False,
help="Skip confirmation prompt.",
)
@click.pass_context
def project_delete(ctx: click.Context, name: str, yes: bool):
"""
Delete a project and all its registered objects.
"""
store = create_feature_store(ctx)

try:
store.get_project(name)
except FeastObjectNotFoundException as e:
print(e)
exit(1)

if not yes:
click.confirm(
f"This will permanently delete project '{name}' and all its registered objects. Are you sure?",
abort=True,
)

store.delete_project(name)
print(f"Project '{name}' successfully deleted.")


@projects_cmd.command(name="list")
@tagsOption
@click.pass_context
Expand Down
13 changes: 13 additions & 0 deletions sdk/python/feast/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -3388,6 +3388,19 @@ def get_project(self, name: Optional[str]) -> Project:
"""
return self.registry.get_project(name or self.project)

def delete_project(self, name: str, commit: bool = True) -> None:
"""
Deletes a project from the registry.

Args:
name: Name of the project to delete.
commit: Whether the change should be persisted immediately.

Raises:
ProjectObjectNotFoundException: The project could not be found.
Comment thread
shuchu marked this conversation as resolved.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ProjectObjectNotFoundException: The project could not be found.
ProjectNotFoundException: The project could not be found.

"""
return self.registry.delete_project(name, commit=commit)

def list_saved_datasets(
self, allow_cache: bool = False, tags: Optional[dict[str, str]] = None
) -> List[SavedDataset]:
Expand Down
Loading