Skip to content

Commit cd7905f

Browse files
resolve issues
1 parent a216324 commit cd7905f

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

python/cocoindex/cli.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,22 @@ def _setup_flows(
285285
setup_bundle.apply(report_to_stdout=not quiet)
286286

287287

288+
def _deprecate_setup_flag(
289+
ctx: click.Context, param: click.Parameter, value: bool
290+
) -> bool:
291+
"""Callback to warn users that --setup flag is deprecated."""
292+
if param.name is not None:
293+
param_source = ctx.get_parameter_source(param.name)
294+
if param_source == click.core.ParameterSource.COMMANDLINE:
295+
click.secho(
296+
"Warning: The --setup flag is deprecated and will be removed in a future version. "
297+
"Setup is now always enabled by default.",
298+
fg="yellow",
299+
err=True,
300+
)
301+
return value
302+
303+
288304
def _show_no_live_update_hint() -> None:
289305
click.secho(
290306
"NOTE: No change capture mechanism exists. See https://cocoindex.io/docs/core/flow_methods#live-update for more details.\n",
@@ -402,8 +418,9 @@ def drop(app_target: str | None, flow_name: tuple[str, ...], force: bool) -> Non
402418
"--setup",
403419
is_flag=True,
404420
show_default=True,
405-
default=False,
406-
help="Automatically setup backends for the flow if it's not setup yet.",
421+
default=True,
422+
callback=_deprecate_setup_flag,
423+
help="(DEPRECATED) Automatically setup backends for the flow if it's not setup yet. This is now the default behavior.",
407424
)
408425
@click.option(
409426
"--reset",
@@ -567,8 +584,9 @@ def evaluate(
567584
"--setup",
568585
is_flag=True,
569586
show_default=True,
570-
default=False,
571-
help="Automatically setup backends for the flow if it's not setup yet.",
587+
default=True,
588+
callback=_deprecate_setup_flag,
589+
help="(DEPRECATED) Automatically setup backends for the flow if it's not setup yet. This is now the default behavior.",
572590
)
573591
@click.option(
574592
"--reset",

src/execution/live_updater.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ impl SourceUpdateTask {
159159
change_stream.next()
160160
.await
161161
.transpose()
162-
.map_err(retryable::Error::always_retryable)
162+
.map_err(retryable::Error::retryable)
163163
},
164164
&retry_options,
165165
)

0 commit comments

Comments
 (0)