Skip to content

feat(characterization): surface unmapped custom-SQL results instead of dropping them - #135

Open
watilde wants to merge 3 commits into
OHDSI:developfrom
watilde:feat/characterization-raw-result-fallback
Open

feat(characterization): surface unmapped custom-SQL results instead of dropping them#135
watilde wants to merge 3 commits into
OHDSI:developfrom
watilde:feat/characterization-raw-result-fallback

Conversation

@watilde

@watilde watilde commented Jul 11, 2026

Copy link
Copy Markdown
Member

Custom feature analyses can emit result rows that fit neither the prevalence nor the distribution shape (e.g. categorical or bespoke columns). The result mapper silently discarded these, so a spec-conformant custom SQL could produce output that never appeared in the UI.

Collect such rows (valid analysisId+covariateId but unclassifiable, or missing cohortId) into a new unmapped bucket and render them verbatim in a new RawResultTable — columns derived dynamically from whatever the rows carry, with a "Custom SQL" badge driven by the (previously unused) faType field. Malformed id-less rows are still dropped. The existing prevalence/distribution paths are untouched.

First, smallest slice of a larger plan to let custom SQL unlock richer Characterization visualisations; the contract here is simply "never make custom output invisible".

…f dropping them

Custom feature analyses can emit result rows that fit neither the
prevalence nor the distribution shape (e.g. categorical or bespoke
columns). The result mapper silently discarded these, so a
spec-conformant custom SQL could produce output that never appeared
in the UI.

Collect such rows (valid analysisId+covariateId but unclassifiable, or
missing cohortId) into a new `unmapped` bucket and render them verbatim
in a new RawResultTable — columns derived dynamically from whatever the
rows carry, with a "Custom SQL" badge driven by the (previously unused)
faType field. Malformed id-less rows are still dropped. The existing
prevalence/distribution paths are untouched.

First, smallest slice of a larger plan to let custom SQL unlock richer
Characterization visualisations; the contract here is simply "never make
custom output invisible".

Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.30%. Comparing base (bb1f6fe) to head (8025743).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #135      +/-   ##
===========================================
+ Coverage    94.27%   94.30%   +0.02%     
===========================================
  Files          448      449       +1     
  Lines        96572    96822     +250     
  Branches      8555     8591      +36     
===========================================
+ Hits         91047    91310     +263     
+ Misses        5525     5512      -13     
Flag Coverage Δ
unit 94.30% <100.00%> (+0.02%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

watilde added 2 commits July 12, 2026 13:24
…-data slot

Add tests for the unmapped/custom-SQL path — PerAnalysisView grouping,
analysisId fallback, analysis/domain filters and empty state; every
RawResultTable formatValue branch; and the mapper's "classifiable but
no cohortId" case. Remove RawResultTable's unreachable no-data slot
(it is only ever rendered for non-empty groups).

Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
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