Skip to content

feat(cli): add stats subcommand to datasets and executions#584

Merged
lewisjared merged 2 commits intomainfrom
stats
Mar 7, 2026
Merged

feat(cli): add stats subcommand to datasets and executions#584
lewisjared merged 2 commits intomainfrom
stats

Conversation

@lewisjared
Copy link
Copy Markdown
Contributor

@lewisjared lewisjared commented Mar 7, 2026

Description

Add ref datasets stats and ref executions stats CLI commands for summary statistics, as requested in #551.

ref datasets stats

  • Shows per-dataset-type counts with file counts and finalisation status breakdown
  • --source-type filter to narrow to a specific dataset type
  • --group-by to expand by source_id or variable_id (requires --source-type)

ref executions stats

  • Shows per-provider/diagnostic counts broken down by status (running, failed, successful, not_started, dirty)
  • Includes (total) rows per provider
  • --provider and --diagnostic filters

Both commands are registered as read-only (skip DB backup on migration).

Closes #551

Checklist

Please confirm that this pull request has done the following:

  • Tests added
  • Documentation added (where applicable)
  • Changelog item added to changelog/

Add `ref datasets stats` and `ref executions stats` commands for
summary statistics without listing individual records.

datasets stats: per-type counts with file counts and finalisation
breakdown. Supports --source-type filter and --group-by (source_id
or variable_id).

executions stats: per-provider/diagnostic counts broken down by
status (running, failed, successful, not_started, dirty) with
provider totals. Supports --provider and --diagnostic filters.

Closes #551
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
core 93.18% <100.00%> (+0.07%) ⬆️
providers 91.79% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ckages/climate-ref/src/climate_ref/cli/__init__.py 95.55% <ø> (ø)
...ckages/climate-ref/src/climate_ref/cli/datasets.py 92.00% <100.00%> (+3.00%) ⬆️
...ages/climate-ref/src/climate_ref/cli/executions.py 94.90% <100.00%> (+0.55%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lewisjared lewisjared merged commit 4601968 into main Mar 7, 2026
26 checks passed
@lewisjared lewisjared deleted the stats branch March 7, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add stats command for executions and datasets

1 participant