-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add CLI command to read runs in WQ #11989
Conversation
✅ Deploy Preview for prefect-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
||
@work_app.command("read-runs") | ||
@experimental_parameter("pool", group="work_pools", when=lambda y: y is not None) | ||
async def read_wq_runs( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be nice to have a couple tests around this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a few tests! Let me know if you think there are edge cases I should be testing for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems to hit all the notes, thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌
|
||
@work_app.command("read-runs") | ||
@experimental_parameter("pool", group="work_pools", when=lambda y: y is not None) | ||
async def read_wq_runs( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems to hit all the notes, thank you!
This PR adds a CLI command to make it easy to read the runs off of a work queue:
My main use case was simulating a worker/agent poll to a work queue to simulate work queue status events. The command was useful during testing and I can image it being useful to test other work queue status related things (i.e. automations, events). Note that running this command is equivalent to a worker polling a work queue and may lead to a temporary false positive where it looks like "something is polling for work" but it was just a one time command.
Example
Checklist
<link to issue>
"maintenance
,fix
,feature
,enhancement
,docs
.For documentation changes:
netlify.toml
for files that are removed or renamed.For new functions or classes in the Python SDK:
mkdocs.yml
navigation.