hi folks
say if I want to delete ALL crashed flow runs
or filter by some other condition & delete all flow runs
how do I do it?
now I am only able to get 200 flow runs in python… not even sure how does it decide which 200
setting up filters for flows in the query is virtual impossible for me (FlowRunFilter, FlowRunFilterState, …. a giant mess doesn’t work)
please tell me I am doing it all wrong and there is an easy way?
prefect 2 + prefect cloud
k
Kevin Wang
11/17/2022, 3:26 PM
Hi Kirill, you'd like to filter by some conditions.. you will need to use
FlowRunFilter
Try the below, you can see the commented params like limit, and sort.
No idea.. Might be some behavior on Prefect Cloud side, but hope that helps you filter for your Crashed runs and you can delete them.
🙌 1
Kevin Wang
11/17/2022, 3:29 PM
Since you are writing Python, I highly recommend cloning the
prefect
repo, which you can search through the code base. and see some tests written with them, as examples.
k
Kirill Popov
11/17/2022, 3:32 PM
@Kevin Wang thanks for the snippet, it worked
too bad prefect cloud does not support retrieveing more than 200 flow runs at once
similar in the UI — only some runs show up 😞
Kirill Popov
11/17/2022, 3:35 PM
also kind of expected to be able to delete flow runs in the UI… multiselect with Shift and delete
a
Anna Geller
11/17/2022, 8:40 PM
you could leverage a for loop - it'S the same way as you would extract data from some API and responses would be paged
Anna Geller
11/17/2022, 8:41 PM
those limits are implemented for performance reasons, tradeoffs that we often have to make
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.