Skip to content

fix: repair NodeNorm status test and refresh Babel expectations - #47

Open
SkyeAv wants to merge 2 commits into
mainfrom
fix/nodenorm-babel-test-drift
Open

fix: repair NodeNorm status test and refresh Babel expectations#47
SkyeAv wants to merge 2 commits into
mainfrom
fix/nodenorm-babel-test-drift

Conversation

@SkyeAv

@SkyeAv SkyeAv commented Jul 29, 2026

Copy link
Copy Markdown
Member

Fixes the four failing tests/test_nodenorm.py checks that were red on main and blocking unrelated PRs (e.g. #45). All four failures trace back to the live Translator services: the NodeNorm /status endpoint never exposed babel_version, and the Babel-backed compendia have drifted the preferred CURIEs, labels, and categories for two example queries.

NodeNorm status test

  • Removed babel_version / babel_version_url assertions from test_nodenorm_status. Unlike NameRes (name-lookup.ci.transltr.io/status), the NodeNorm /status response only reports status and databases; asserting those keys raised KeyError: 'babel_version'. The NameRes status test still asserts babel_version and continues to pass.
  • Kept the stable checks: status['status'] == 'running' and databases['eq_id_to_id_db']['count'] > 650_000_000.

Normalization expectations

  • UMLS:C0004096 (asthma): preferred CURIE MONDO:0004979MONDO:0100470, label asthmaAsthma.
  • DRUGBANK:DB00083 (botulinum toxin type A): preferred CURIE UMLS:C0006050DRUGBANK:DB00083, label DysportBotulinum toxin type A, category biolink:Proteinbiolink:ChemicalEntity.

Design

  • Accepted caveat: EXAMPLE_QUERIES pins exact preferred CURIEs/labels/categories to the live Babel-backed NodeNorm, so these will drift again on the next compendia release. A comment now documents this so the next refresh is obvious. Relaxing to shape-only assertions would lose the characterization coverage these tests provide, so the pinned values were refreshed instead.
  • No source changes: only tests/test_nodenorm.py is touched; TCT/node_normalizer.py and the NameRes tests are unchanged.

Testing

  • uv run pytest tests/test_nodenorm.py --no-cov -q11 passed in 17.04s
  • uv run pytest tests/ --no-cov -q47 passed, 1 skipped in 34.47s
  • uv run ruff check tests/test_nodenorm.pyAll checks passed!
  • Drifted values verified against the live endpoints (nodenorm.transltr.io/get_normalized_nodes) for UMLS:C0004096 and DRUGBANK:DB00083.

SkyeAv added 2 commits July 29, 2026 12:48
The NodeNorm `/status` endpoint does not report `babel_version` or
`babel_version_url` (that compendia metadata is exposed by the NameRes
`/status` endpoint, whose test still passes). Asserting those keys on
NodeNorm raised `KeyError: 'babel_version'` and failed CI.

Assert only the fields NodeNorm actually returns: `status` and the
underlying Redis database counts.
Two NodeNorm normalization examples had drifted from the current
NCATSTranslator/Babel compendia and failed CI:

- UMLS:C0004096 (asthma): preferred CURIE MONDO:0004979 -> MONDO:0100470,
  label 'asthma' -> 'Asthma'.
- DRUGBANK:DB00083 (botulinum toxin type A): preferred CURIE
  UMLS:C0006050 -> DRUGBANK:DB00083, label 'Dysport' ->
  'Botulinum toxin type A', category biolink:Protein ->
  biolink:ChemicalEntity.

Also document at EXAMPLE_QUERIES that these expectations track the live
Babel-backed NodeNorm service and may need a periodic refresh.
@SkyeAv
SkyeAv requested a review from gloriachin July 29, 2026 21:34
@SkyeAv SkyeAv added bug Something isn't working testing labels Jul 29, 2026
@SkyeAv

SkyeAv commented Jul 29, 2026

Copy link
Copy Markdown
Member Author
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant