lazy: repair fallout from store-infra resolve

The resolve brought over the pydantic ToolIndex and the incremental/twin
populate tests without adapting lazy-only surface: benchmarks.py still
called the deleted to_dict/from_dict, and the test config stubs lacked
the data-manager conf and biotools attributes the lazy populate path
reads. Convert benchmarks to model_dump/model_validate and consolidate
the two identical test stubs into one _populate_config helper carrying
the full attribute set.

Claude-Session: https://claude.ai/code/session_018L7ZmCv2ubKA3JNeSL8Pkr
This commit is contained in:
mvdbeek
2026-07-28 17:27:29 +02:00
parent 67b9851d3e
commit d25e6f1140
+5 -5
View File
@@ -268,23 +268,23 @@ class ToolSourceBenchmarks:
)
def benchmark_index_serialization(self, iterations: int = 50) -> BenchmarkResult:
"""Benchmark index to_dict serialization."""
"""Benchmark index serialization to JSON-ready dicts."""
index = self._build_sample_index(1000)
return benchmark_function(
"index_serialization",
lambda: index.to_dict(),
lambda: index.model_dump(mode="json"),
iterations,
)
def benchmark_index_deserialization(self, iterations: int = 50) -> BenchmarkResult:
"""Benchmark index from_dict deserialization."""
"""Benchmark index deserialization from JSON-ready dicts."""
index = self._build_sample_index(1000)
data = index.to_dict()
data = index.model_dump(mode="json")
return benchmark_function(
"index_deserialization",
lambda: ToolIndex.from_dict(data),
lambda: ToolIndex.model_validate(data),
iterations,
)