From d0ba589f9b0b07dfc3bcb952e0976f9c0c3b0771 Mon Sep 17 00:00:00 2001 From: Lawrence Babb Date: Wed, 30 Sep 2026 17:13:22 +0800 Subject: [PATCH 1/2] test: validate base-namespace fixtures again The va-spec 1.1.0-ballot.2026-09 submodule labels core/base test fixtures with the namespace ``va-spec`` (no dot), whereas profile fixtures use ``va-spec.``. The fixture-discovery loop only processed namespaces matching ``startswith("va-spec.")``, so all 39 base fixtures were silently dropped and ``test_va_spec_fixtures`` validated only the 20 profile fixtures while still passing green. Accept the bare ``va-spec`` namespace so base fixtures are routed to VaSpecSchema.BASE and validated again, and skip (rather than KeyError on) any namespace that ``get_va_spec_schema`` does not recognize. Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/validation/test_va_spec_fixtures_validation.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/validation/test_va_spec_fixtures_validation.py b/tests/validation/test_va_spec_fixtures_validation.py index ab68c08..941ae68 100644 --- a/tests/validation/test_va_spec_fixtures_validation.py +++ b/tests/validation/test_va_spec_fixtures_validation.py @@ -22,9 +22,15 @@ for test_def in test_definitions: - if test_def["namespace"].startswith("va-spec."): - schema = get_va_spec_schema(test_def["namespace"].split("va-spec.")[-1]) - VA_SPEC_TEST_DEFINITIONS[schema].append(test_def) + namespace = test_def["namespace"] + # Base (core) fixtures use the namespace ``va-spec``; profiles use + # ``va-spec.``. Anything else (e.g. ``vrs``) is out of scope. + if namespace != "va-spec" and not namespace.startswith("va-spec."): + continue + schema = get_va_spec_schema(namespace.split("va-spec.")[-1]) + if schema is None: + continue + VA_SPEC_TEST_DEFINITIONS[schema].append(test_def) def test_va_spec_fixtures(): From 345d4a6765763cab8306835c3ea23d79f134d8aa Mon Sep 17 00:00:00 2001 From: Lawrence Babb Date: Wed, 30 Sep 2026 17:14:41 +0800 Subject: [PATCH 2/2] fix: guard tier evidence-line validator against non-dict input ``validate_tier_evidence_lines`` runs in pydantic ``mode="before"`` and immediately called ``values.get(...)``. When the model is validated from a non-dict input (e.g. ``VariantClinicalSignificanceStatement.model_validate`` called with a string/list/other object), that raised ``AttributeError`` instead of surfacing a normal validation error. Return non-dict input unchanged so pydantic handles it through its usual path, matching the pattern used by the nested ``classification``/``primaryCoding`` type guards already in this validator. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/ga4gh/va_spec/aac_2017/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ga4gh/va_spec/aac_2017/models.py b/src/ga4gh/va_spec/aac_2017/models.py index 83b1566..3f83a1c 100644 --- a/src/ga4gh/va_spec/aac_2017/models.py +++ b/src/ga4gh/va_spec/aac_2017/models.py @@ -224,6 +224,9 @@ class VariantClinicalSignificanceStatement( @classmethod def validate_tier_evidence_lines(cls, values: dict) -> dict: """Validate tier I and II evidence-line types before base coercion.""" + if not isinstance(values, dict): + return values + classification = values.get("classification") if not isinstance(classification, dict): return values