fix: repair NodeNorm status test and refresh Babel expectations - #47
Open
SkyeAv wants to merge 2 commits into
Open
fix: repair NodeNorm status test and refresh Babel expectations#47SkyeAv wants to merge 2 commits into
SkyeAv wants to merge 2 commits into
Conversation
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.
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes the four failing
tests/test_nodenorm.pychecks that were red onmainand blocking unrelated PRs (e.g. #45). All four failures trace back to the live Translator services: the NodeNorm/statusendpoint never exposedbabel_version, and the Babel-backed compendia have drifted the preferred CURIEs, labels, and categories for two example queries.NodeNorm status test
babel_version/babel_version_urlassertions fromtest_nodenorm_status. Unlike NameRes (name-lookup.ci.transltr.io/status), the NodeNorm/statusresponse only reportsstatusanddatabases; asserting those keys raisedKeyError: 'babel_version'. The NameRes status test still assertsbabel_versionand continues to pass.status['status'] == 'running'anddatabases['eq_id_to_id_db']['count'] > 650_000_000.Normalization expectations
UMLS:C0004096(asthma): preferred CURIEMONDO:0004979→MONDO:0100470, labelasthma→Asthma.DRUGBANK:DB00083(botulinum toxin type A): preferred CURIEUMLS:C0006050→DRUGBANK:DB00083, labelDysport→Botulinum toxin type A, categorybiolink:Protein→biolink:ChemicalEntity.Design
EXAMPLE_QUERIESpins 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.tests/test_nodenorm.pyis touched;TCT/node_normalizer.pyand the NameRes tests are unchanged.Testing
uv run pytest tests/test_nodenorm.py --no-cov -q→11 passed in 17.04suv run pytest tests/ --no-cov -q→47 passed, 1 skipped in 34.47suv run ruff check tests/test_nodenorm.py→All checks passed!nodenorm.transltr.io/get_normalized_nodes) forUMLS:C0004096andDRUGBANK:DB00083.