Skip to content

Commit cf62b44

Browse files
modify 'ResultSet' to prevent inadvertently overriding static fields
1 parent 8d32e34 commit cf62b44

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/anyvlm/schemas/vlm.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from anyvlm.utils.types import Zygosity
99

10-
# ruff: noqa: N815, D107 (allow camelCase vars instead of snake_case to align with expected VLM protocol response + don't require init docstrings)
10+
# ruff: noqa: N815, N803, D107 (allow camelCase instead of snake_case to align with expected VLM protocol response + don't require init docstrings)
1111

1212
RESULT_ENTITY_TYPE = "genomicVariant"
1313

@@ -134,6 +134,9 @@ class ResultSet(BaseModel):
134134
description=f"The type of entity relevant to these results. Must always be set to '{RESULT_ENTITY_TYPE}'",
135135
)
136136

137+
def __init__(self, resultset_id: str, resultsCount: int) -> None:
138+
super().__init__(id=resultset_id, resultsCount=resultsCount)
139+
137140

138141
class ResponseField(BaseModel):
139142
"""A list of ResultSets"""

tests/unit/test_schemas.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import pytest
66

77
from anyvlm.schemas.vlm import (
8-
RESULT_ENTITY_TYPE,
98
HandoverType,
109
ResponseField,
1110
ResponseSummary,
@@ -59,10 +58,8 @@ def test_valid_resultset_id(response_summary, valid_handover_id):
5958
response = ResponseField(
6059
resultSets=[
6160
ResultSet(
62-
exists=True,
6361
id=f"{valid_handover_id} {Zygosity.HOMOZYGOUS}",
6462
resultsCount=0,
65-
setType=RESULT_ENTITY_TYPE,
6663
)
6764
]
6865
)

0 commit comments

Comments
 (0)