feat: adds caching per namespace #67
Reference in New Issue
Block a user
Delete Branch "feature/cache-per-namespace"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This pull request refactors the reference cache mechanism in the
SchemaConverterclass to support multiple isolated namespaces for schema references, improving schema model isolation and cache management. The changes also introduce comprehensive tests to verify correct behavior for reference caching, namespace isolation, and cache clearing.Refactoring reference cache to support namespaces
SchemaConverterto use anamespace_registry(dictionary of reference caches keyed by schema$idor namespace) instead of a single reference cache, enabling isolated caches per schema namespace. (jambo/schema_converter.py)build_with_cachemethod to select or create a reference cache based on the schema's$id, ensuring models from different schemas do not collide in the cache. (jambo/schema_converter.py)clear_ref_cacheandget_cached_refmethods to operate on a specific namespace, allowing targeted or global cache clearing and lookup. (jambo/schema_converter.py)Enhancements to test coverage
$ids, collision when$idmatches, namespace-based cache lookup, and clearing of namespace-specific caches. (tests/test_schema_converter.py)tests/test_schema_converter.py)Codecov Report
✅ All modified and coverable lines are covered by tests.
📢 Thoughts on this report? Let us know!