Skip to content

fix(cli): fix bug of cocoindex drop #533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion python/cocoindex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from .auth_registry import AuthEntryReference, add_auth_entry, ref_auth_entry
from .flow import FlowBuilder, DataScope, DataSlice, Flow, transform_flow
from .flow import flow_def, flow_def as flow
from .flow import flow_def
from .flow import EvaluateAndDumpOptions, GeneratedField
from .flow import update_all_flows_async, FlowLiveUpdater, FlowLiveUpdaterOptions
from .lib import init, start_server, stop, main_fn
Expand Down
18 changes: 10 additions & 8 deletions python/cocoindex/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,10 @@ def drop(app_target: str | None, flow_name: tuple[str, ...], drop_all: bool):
"""
Drop the backend setup for flows.

Modes of operation:\n
1. Drop ALL persisted setups: `cocoindex drop --all`\n
2. Drop all flows defined in an app: `cocoindex drop <APP_TARGET>`\n
\b
Modes of operation:
1. Drop ALL persisted setups: `cocoindex drop --all`
2. Drop all flows defined in an app: `cocoindex drop <APP_TARGET>`
3. Drop specific named flows: `cocoindex drop <APP_TARGET> [FLOW_NAME...]`
"""
app_ref = None
Expand All @@ -270,7 +271,7 @@ def drop(app_target: str | None, flow_name: tuple[str, ...], drop_all: bool):
flow_names = list(flow_name)
click.echo(f"Preparing to drop specified flows: {', '.join(flow_names)} (in '{app_ref}').", err=True)
else:
flow_names = [fl.name for fl in flow.flows()]
flow_names = flow.flow_names()
if not flow_names:
click.echo(f"No flows found defined in '{app_ref}' to drop.")
return
Expand Down Expand Up @@ -338,11 +339,12 @@ def evaluate(app_flow_specifier: str, output_dir: str | None, cache: bool = True
Instead of updating the index, it dumps what should be indexed to files.
Mainly used for evaluation purpose.

\b
APP_FLOW_SPECIFIER: Specifies the application and optionally the target flow.
Can be one of the following formats:\n
- path/to/your_app.py\n
- an_installed.module_name\n
- path/to/your_app.py:SpecificFlowName\n
Can be one of the following formats:
- path/to/your_app.py
- an_installed.module_name
- path/to/your_app.py:SpecificFlowName
- an_installed.module_name:SpecificFlowName

:SpecificFlowName can be omitted only if the application defines a single flow.
Expand Down
Loading