Skip to content

Commit

Permalink
Remove poll_interval and watch_interval args
Browse files Browse the repository at this point in the history
  • Loading branch information
bnaul committed Feb 21, 2025
1 parent 5bd5b09 commit 53a1242
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
11 changes: 0 additions & 11 deletions src/prefect/cli/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,11 +735,6 @@ async def run(
"--watch",
help=("Whether to poll the flow run until a terminal state is reached."),
),
watch_interval: Optional[int] = typer.Option(
None,
"--watch-interval",
help=("How often to poll the flow run for state changes (in seconds)."),
),
watch_timeout: Optional[int] = typer.Option(
None,
"--watch-timeout",
Expand Down Expand Up @@ -768,10 +763,6 @@ async def run(
multi_params = json.loads(multiparams)
except ValueError as exc:
exit_with_error(f"Failed to parse JSON: {exc}")
if watch_interval and not watch:
exit_with_error(
"`--watch-interval` can only be used with `--watch`.",
)
cli_params: dict[str, Any] = _load_json_key_values(params or [], "parameter")
conflicting_keys = set(cli_params.keys()).intersection(multi_params.keys())
if conflicting_keys:
Expand Down Expand Up @@ -894,12 +885,10 @@ async def run(
soft_wrap=True,
)
if watch:
watch_interval = 5 if watch_interval is None else watch_interval
app.console.print(f"Watching flow run {flow_run.name!r}...")
finished_flow_run = await wait_for_flow_run(
flow_run.id,
timeout=watch_timeout,
poll_interval=watch_interval,
log_states=True,
)
finished_flow_run_state = finished_flow_run.state
Expand Down
7 changes: 0 additions & 7 deletions src/prefect/flow_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
async def wait_for_flow_run(
flow_run_id: UUID,
timeout: int | None = 10800,
poll_interval: int | None = None,
client: "PrefectClient | None" = None,
log_states: bool = False,
) -> FlowRun:
Expand All @@ -66,7 +65,6 @@ async def wait_for_flow_run(
Args:
flow_run_id: The flow run ID for the flow run to wait for.
timeout: The wait timeout in seconds. Defaults to 10800 (3 hours).
poll_interval: Deprecated; polling is no longer used to wait for flow runs.
client: Optional Prefect client. If not provided, one will be injected.
log_states: If True, log state changes. Defaults to False.
Expand Down Expand Up @@ -118,11 +116,6 @@ async def main(num_runs: int):
```
"""
if poll_interval is not None:
get_logger().warning(
"The `poll_interval` argument is deprecated and will be removed in a future release. "
)

assert client is not None, "Client injection failed"
logger = get_logger()

Expand Down

0 comments on commit 53a1242

Please sign in to comment.