Skip to content

Extract shared _KeyedCache helper from CachedNodeNorm and CachedNameRes #85

@gaurav

Description

@gaurav

Background

src/babel_validation/services/nodenorm.py and src/babel_validation/services/nameres.py both implement identical cache structures:

  • (query, frozenset(params.items())) tuple keys
  • Parallel clear_curie / delete_query O(N) sweep methods
  • Parallel from_url registries

This duplication means bug fixes or improvements to the cache logic must be applied in two places.

Proposed fix

Extract a small _KeyedCache helper (or a shared base class / mixin) in src/babel_validation/services/ that both CachedNodeNorm and CachedNameRes can reuse. Not blocking for the current PR, but worth cleaning up as the services layer grows.

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions