fix: Add batch delete and cancel support for flow runs#22279
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fb5511d7a5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| """Cancel a flow run by ID.""" | ||
| flow_run_ids = list(ids) | ||
|
|
||
| if sys.stdin: |
There was a problem hiding this comment.
Honor --stdin before reading standard input
When prefect flow-run cancel <id> is run from an interactive terminal without --stdin, sys.stdin is still truthy, so this loop waits for EOF before any cancellation occurs; with piped input it also consumes and parses unrelated stdin as UUIDs. Gate this block on the stdin option, matching the new delete command behavior, so the normal cancellation path does not block or read unexpected input.
Useful? React with 👍 / 👎.
Signed-off-by: Hemant M Mehta <hemant29mehta@gmail.com>
Merging this PR will not alter performance
Comparing Footnotes
|
Signed-off-by: Hemant M Mehta <hemant29mehta@gmail.com>
Signed-off-by: Hemant M Mehta <hemant29mehta@gmail.com>
|
@desertaxle, can you review this PR? |
closes: #19904
Adds support for batch operations for flow runs by allowing multiple flow run IDs to be passed to the CLI commands.
Before:
prefect flow-run delete id1
prefect flow-run delete id2
prefect flow-run delete id3
After:
prefect flow-run delete id1 id2 id3