From b537f084c8466d0c03723fa79494ff2c8f1c2fdc Mon Sep 17 00:00:00 2001 From: Kori Kuzma Date: Mon, 5 Oct 2026 07:45:57 -0400 Subject: [PATCH] fix: Statement.direction is required --- src/ga4gh/va_spec/base/core.py | 4 ++-- submodules/va_spec | 2 +- tests/test_imports.py | 4 +++- tests/validation/test_va_spec_models.py | 9 +++++++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/ga4gh/va_spec/base/core.py b/src/ga4gh/va_spec/base/core.py index a319e0a..550be54 100644 --- a/src/ga4gh/va_spec/base/core.py +++ b/src/ga4gh/va_spec/base/core.py @@ -989,8 +989,8 @@ class Statement(InformationEntity, BaseModelForbidExtra): ..., description="A possible fact, the validity of which is assessed and reported by the Statement. A Statement can put forth the proposition as being true, false, or uncertain, and may provide an assessment of the level of confidence/evidence supporting this claim.", ) - direction: Direction | None = Field( - default=None, + direction: Direction = Field( + ..., description="A term indicating whether the Statement supports, disputes, or remains neutral w.r.t. the validity of the Proposition it evaluates.", ) strength: MappableConcept | iriReference | None = Field( diff --git a/submodules/va_spec b/submodules/va_spec index 2957348..d9da20c 160000 --- a/submodules/va_spec +++ b/submodules/va_spec @@ -1 +1 @@ -Subproject commit 29573487fe340827f28304dd43e0353e05db1524 +Subproject commit d9da20ca3c1a8fd20044bf45cc921ea38198b05f diff --git a/tests/test_imports.py b/tests/test_imports.py index 719da60..74f00eb 100644 --- a/tests/test_imports.py +++ b/tests/test_imports.py @@ -12,13 +12,15 @@ def test_public_modules_import_and_resolve_recursive_models(): import ga4gh.va_spec.acmg_2015 import ga4gh.va_spec.base import ga4gh.va_spec.ccv_2022 -from ga4gh.va_spec.base import Statement +from ga4gh.va_spec.base import Direction, Statement Statement( + direction=Direction.SUPPORTS, proposition={"type": "Proposition", "subject": {}, "predicate": "relatedTo", "object": {}}, hasEvidence=[ { "type": "Statement", + "direction": "supports", "proposition": {"type": "Proposition", "subject": {}, "predicate": "relatedTo", "object": {}}, } ], diff --git a/tests/validation/test_va_spec_models.py b/tests/validation/test_va_spec_models.py index 6b95d52..be327db 100644 --- a/tests/validation/test_va_spec_models.py +++ b/tests/validation/test_va_spec_models.py @@ -484,7 +484,9 @@ def test_variant_pathogenicity_stmt(pathogenicity_evidence_line_params): def test_statement_proposition_accepts_iri_reference(): """Statements may reference a proposition instead of embedding one.""" - statement = Statement(proposition="propositions.json#/1") + statement = Statement( + proposition="propositions.json#/1", direction=Direction.SUPPORTS + ) assert statement.proposition == iriReference(root="propositions.json#/1") @@ -495,7 +497,7 @@ def test_base_statement_and_evidence_line_accept_generic_propositions(): type="Proposition", subject={}, predicate="relatedTo", object={} ) - statement = Statement(proposition=proposition) + statement = Statement(proposition=proposition, direction=Direction.SUPPORTS) evidence_line = EvidenceLine( directionOfEvidenceProvided="neutral", targetProposition=proposition ) @@ -656,6 +658,7 @@ def test_pathogenicity_profile_accepts_schema_permitted_references(): strengthOfEvidenceProvided="strengths.json#/1", ) statement = VariantPathogenicityStatement( + direction=Direction.SUPPORTS, proposition="propositions.json#/1", strength="strengths.json#/1", classification="classifications.json#/1", @@ -799,6 +802,7 @@ def test_oncogenicity_profile_accepts_schema_permitted_references(): strengthOfEvidenceProvided="strengths.json#/1", ) statement = VariantOncogenicityStatement( + direction=Direction.SUPPORTS, proposition="propositions.json#/1", strength="strengths.json#/1", classification="classifications.json#/1", @@ -844,6 +848,7 @@ def test_variant_onco_el_no_evidence_outcome(): def test_aac_profile_accepts_schema_permitted_references(): """AAC models accept opaque classification and strength IRIs.""" statement = VariantClinicalSignificanceStatement( + direction=Direction.SUPPORTS, proposition="propositions.json#/1", strength="strengths.json#/1", classification="classifications.json#/1",