Skip to content

Make build_demo optional, skip demo-less datasets in tests#312

Merged
mmcdermott merged 1 commit into
devfrom
feat/dataset-demo-availability
May 13, 2026
Merged

Make build_demo optional, skip demo-less datasets in tests#312
mmcdermott merged 1 commit into
devfrom
feat/dataset-demo-availability

Conversation

@mmcdermott

@mmcdermott mmcdermott commented May 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Prerequisite for the per-dataset registration PRs (#305 AUMCdb, #306 EHRShot, #307 HIRID, #308 INSPIRE, #309 NWICU, #310 SICdb, #311 eICU). Most of those datasets' upstream extractors don't ship a publicly-installable demo, and the existing registry validation requires every dataset to declare a build_demo command.

Switches the convention to: a dataset has a demo iff its commands declare build_demo. The absence of the key is itself the signal — no separate metadata field, no echo "..." stubs, and no two-sources-of-truth ambiguity.

What changes

Three small edits, no behavior change for datasets that already declare build_demo (e.g., MIMIC-IV):

  • test_all_datasets_have_commands now requires build_full (which every dataset still needs) and allows missing build_demo.
  • tests/conftest.py drops datasets without build_demo from the integration test matrix, so a per-dataset CI lane for one collects zero parametrized tests and passes cleanly rather than trying to build data the dataset can't produce.
  • src/MEDS_DEV/datasets/__main__.py raises a clear ValueError when called with demo=True against a dataset that doesn't declare a build_demo command (instead of the previous KeyError).

No dataset.yaml files change here — those changes ship with the sister per-dataset PRs that depend on this one.

Test plan

  • Pre-commit passes.
  • Fast test suite passes (53 tests, including the existing registry validation against MIMIC-IV).
  • N/A: no new doctests; the logic is exercised by registry validation + the per-dataset integration lanes.

Refs

🤖 Generated with Claude Code

@codecov

codecov Bot commented May 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/MEDS_DEV/datasets/__main__.py 60.00% 2 Missing ⚠️
Files with missing lines Coverage Δ
src/MEDS_DEV/datasets/__main__.py 92.30% <60.00%> (-7.70%) ⬇️

Prerequisite for the per-dataset registration PRs (#305 AUMCdb, #306
EHRShot, #307 HIRID, #308 INSPIRE, #309 NWICU, #310 SICdb, #311 eICU).
Most of those datasets' upstream extractors don't ship a publicly
installable demo, and the existing registry validation requires every
dataset to declare a build_demo command.

Switches the convention to: a dataset has a demo iff its commands
declare build_demo. Absence is the signal — no separate metadata field.

- `test_all_datasets_have_commands` now requires `build_full` (which
  every dataset still needs) and allows missing `build_demo`.
- `tests/conftest.py` drops datasets without `build_demo` from the
  integration test matrix, so a per-dataset CI lane for one collects
  zero parametrized tests and passes cleanly rather than trying to
  build data the dataset can't produce.
- `src/MEDS_DEV/datasets/__main__.py` raises a clear error when called
  with `demo=True` against a dataset that doesn't declare a
  build_demo command (instead of the previous KeyError).

No dataset.yaml files change here — those changes ship with the sister
per-dataset PRs that depend on this one.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mmcdermott
mmcdermott force-pushed the feat/dataset-demo-availability branch from 17019a0 to a2d4038 Compare May 13, 2026 17:20
@mmcdermott mmcdermott changed the title Add demo_available opt-out for datasets without demo recipes Make build_demo optional, skip demo-less datasets in tests May 13, 2026
@mmcdermott
mmcdermott merged commit b9c09e7 into dev May 13, 2026
10 checks passed
@mmcdermott
mmcdermott deleted the feat/dataset-demo-availability branch May 13, 2026 17:43
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.

1 participant