Repository navigation
feat(results): share execution scope between value and resource filters - #977
Conversation
Allows resource summaries and measurements to count only each group's latest execution. This answers what one run of a diagnostic costs, while the default still totals the compute spent.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Change: Feature Merge Risk: ⚪ Minimal · up to
|
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…ilters Adds ExecutionScope, holding include_retracted and latest_only, and apply_execution_scope. MetricValueFilter, ResourceFilter and with_values now apply retraction and latest the same way. ResourceFilter gains include_retracted, so summaries and measurements skip retracted executions by default. profiles keeps every sample, retracted ones included.
Retracted executions are now excluded everywhere unless a caller opts in. ResourcesReader.measurement still finds one by id, and profiles accepts a ResourceFilter. Also tidies the filter docstrings, treats an empty slug as a constraint, and tests stats and promoted scoping.
Adds
latest_onlyandinclude_retractedtoResourceFilter, through a sharedExecutionScopethatMetricValueFilternow uses too. One helper,apply_execution_scope, applies both to any select joined toExecution, so values, resources andDiagnosticsReader.with_valuestreat retraction and "latest" the same way.The defaults answer how much compute was spent, retries and failures included.
latest_onlyanswers what one run of a diagnostic costs, because old retries no longer inflate the total and quick failures no longer drag down the mean. ref-app currently mixes the two: the diagnostic page totals every execution, while the catalog counts only the promoted version.Retracted executions are excluded by default everywhere, unless a caller passes
include_retracted=True. The one exception isResourcesReader.measurement(execution_id), because a lookup by id names the execution.Behaviour changes:
ResourcesReader.summary,summaries,measurementsandprofilesnow skip retracted executions by default.ResourcesReader.profilesaccepts aResourceFilter, so it takeslatest_only,include_retractedand the exact slugs. The existing keyword arguments still work, but cannot be combined with a filter.MetricValueFilter(diagnostic_slug="")now matches nothing, likeResourceFilter, instead of ignoring the slug.MetricValueFilter(latest_only=True, include_retracted=True)now joinsExecution. The rows returned are the same.latest_onlypicks the latest execution before retracted ones are dropped. So if a group's newest execution is retracted, that group gives nothing unlessinclude_retracted=True. It never falls back to an older execution, because the newer one superseded it.DatasetFilterdrops retracted rows first instead, because an older dataset version is still valid.Execution statistics and
ExecutionsReader.groupsstill ignore retraction, because they report run status rather than results.ResourceFiltercounts every diagnostic version. Nothing setsExecution.retractedyet, so none of this changes current output.