Skip to content

Commit 22eeb59

Browse files
authored
fix(cli): fix bug of cocoindex drop (#533)
1 parent 7ce63a0 commit 22eeb59

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

python/cocoindex/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from .auth_registry import AuthEntryReference, add_auth_entry, ref_auth_entry
77
from .flow import FlowBuilder, DataScope, DataSlice, Flow, transform_flow
8-
from .flow import flow_def, flow_def as flow
8+
from .flow import flow_def
99
from .flow import EvaluateAndDumpOptions, GeneratedField
1010
from .flow import update_all_flows_async, FlowLiveUpdater, FlowLiveUpdaterOptions
1111
from .lib import init, start_server, stop, main_fn

python/cocoindex/cli.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,10 @@ def drop(app_target: str | None, flow_name: tuple[str, ...], drop_all: bool):
251251
"""
252252
Drop the backend setup for flows.
253253
254-
Modes of operation:\n
255-
1. Drop ALL persisted setups: `cocoindex drop --all`\n
256-
2. Drop all flows defined in an app: `cocoindex drop <APP_TARGET>`\n
254+
\b
255+
Modes of operation:
256+
1. Drop ALL persisted setups: `cocoindex drop --all`
257+
2. Drop all flows defined in an app: `cocoindex drop <APP_TARGET>`
257258
3. Drop specific named flows: `cocoindex drop <APP_TARGET> [FLOW_NAME...]`
258259
"""
259260
app_ref = None
@@ -270,7 +271,7 @@ def drop(app_target: str | None, flow_name: tuple[str, ...], drop_all: bool):
270271
flow_names = list(flow_name)
271272
click.echo(f"Preparing to drop specified flows: {', '.join(flow_names)} (in '{app_ref}').", err=True)
272273
else:
273-
flow_names = [fl.name for fl in flow.flows()]
274+
flow_names = flow.flow_names()
274275
if not flow_names:
275276
click.echo(f"No flows found defined in '{app_ref}' to drop.")
276277
return
@@ -338,11 +339,12 @@ def evaluate(app_flow_specifier: str, output_dir: str | None, cache: bool = True
338339
Instead of updating the index, it dumps what should be indexed to files.
339340
Mainly used for evaluation purpose.
340341
342+
\b
341343
APP_FLOW_SPECIFIER: Specifies the application and optionally the target flow.
342-
Can be one of the following formats:\n
343-
- path/to/your_app.py\n
344-
- an_installed.module_name\n
345-
- path/to/your_app.py:SpecificFlowName\n
344+
Can be one of the following formats:
345+
- path/to/your_app.py
346+
- an_installed.module_name
347+
- path/to/your_app.py:SpecificFlowName
346348
- an_installed.module_name:SpecificFlowName
347349
348350
:SpecificFlowName can be omitted only if the application defines a single flow.

0 commit comments

Comments
 (0)