-
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
avoid fetching runs in runs feed if backfill filter is set and we are hiding runs within backfills #25904
base: master
Are you sure you want to change the base?
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @jamiedemaria and the rest of your teammates on Graphite |
@@ -496,7 +496,7 @@ def _bulk_action_filters_from_run_filters(filters: RunsFilter) -> BulkActionsFil | |||
_bulk_action_statuses_from_run_statuses(filters.statuses) if filters.statuses else None | |||
) | |||
backfill_ids = None | |||
if filters.tags and filters.tags.get(BACKFILL_ID_TAG) is not None: | |||
if filters.tags.get(BACKFILL_ID_TAG) is not None: |
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.
in making the change in this PR i noticed that the filters.tags
check is unnecessary since filters.tags
is never None, it defaults to {}
] | ||
# if we are not showing runs within backfills and the backfill_id filter is set, we know | ||
# there will be no results, so we can skip fetching runs | ||
should_fetch_runs = not (exclude_subruns and run_filters.tags.get(BACKFILL_ID_TAG) is not None) |
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.
when we add the option to only show backfills this condition will become more complicated and probably warrant it's own function
… hiding runs within backfills
edd88e0
to
10cd2d9
Compare
Summary & Motivation
If a user filters for a specific backfill in the default runs feed view, we end up making an inefficient query like this
This is because the default view of the Runs page excludes subruns, which is the
runs.backfill_id IS NULL
. This is an inefficient query and we have enough knowledge prior to running the query to know it will return no results. So we can just skip fetching runs if we see we are in this caseHow I Tested These Changes
Changelog