Skip to content

Conversation

hanhwanglim
Copy link
Contributor

Closes #18652

Added a new count_flow_runs() method to the client API that returns the count of flow runs matching given filters, without fetching the actual flow run objects.

Performance optimization - much more efficient than calling read_flow_runs() just to count results.

Checklist

  • This pull request references any related issue by including "closes <link to issue>"
    • If no issue exists and your change is not a small fix, please create an issue first.
  • If this pull request adds new functionality, it includes unit tests that cover the changes
  • If this pull request removes docs files, it includes redirect settings in mint.json.
  • If this pull request adds functions or classes, it includes helpful docstrings.

@github-actions github-actions bot added the enhancement An improvement of an existing feature label Aug 14, 2025
Copy link

codspeed-hq bot commented Aug 14, 2025

CodSpeed Performance Report

Merging #18713 will not alter performance

Comparing hanhwanglim:expose-count (f16018c) with main (1d0ee05)

Summary

✅ 2 untouched benchmarks

@desertaxle
Copy link
Member

desertaxle commented Aug 14, 2025

Thanks for the PR @hanhwanglim, it looks great! I just want to make sure you reference the correct issue with your closes comment since the issue you linked seems to be to add a count_task_runs_by_state method.

@hanhwanglim
Copy link
Contributor Author

Thanks for the PR @hanhwanglim, it looks great! I just want to make sure you reference the correct issue with your closes comment since the issue you linked seems to be to add a count_task_runs_by_state method.

oops. i have forgotten to change the title of the issue. but the body of the issue describes the problem that this PR addresses. i will change the issue title.

Copy link
Member

@desertaxle desertaxle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@desertaxle desertaxle merged commit 8311cf1 into PrefectHQ:main Aug 18, 2025
60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose count_flow_runs in the prefect client
2 participants