Skip to content

Commit

Permalink
Use functools.lru_cache instead of functools.cache
Browse files Browse the repository at this point in the history
functools.cache is basically just a wrapper around functools.lru_cache, but it wasn't added until Python 3.9. Since we support Python 3.8, we need to use lru_cache instead.
  • Loading branch information
courtneyholcomb committed May 23, 2024
1 parent 2afbfc2 commit 87ddb5c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(self, semantic_manifest: SemanticManifest, semantic_model_lookup: S
max_entity_links=MAX_JOIN_HOPS,
)

@functools.cache
@functools.lru_cache
def linkable_elements_for_measure(
self,
measure_reference: MeasureReference,
Expand All @@ -68,7 +68,7 @@ def linkable_elements_for_measure(

return linkable_element_set

@functools.cache
@functools.lru_cache
def linkable_elements_for_no_metrics_query(
self,
with_any_of: Optional[FrozenSet[LinkableElementProperty]] = None,
Expand All @@ -83,7 +83,7 @@ def linkable_elements_for_no_metrics_query(
without_any_of=frozen_without_any_of,
)

@functools.cache
@functools.lru_cache
def linkable_elements_for_metrics(
self,
metric_references: Sequence[MetricReference],
Expand Down

0 comments on commit 87ddb5c

Please sign in to comment.