From 87ddb5c19c3189882dc5268326c7550ab5d627ba Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Thu, 23 May 2024 15:56:24 -0700 Subject: [PATCH] Use functools.lru_cache instead of functools.cache 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. --- .../metricflow_semantics/model/semantics/metric_lookup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/metricflow-semantics/metricflow_semantics/model/semantics/metric_lookup.py b/metricflow-semantics/metricflow_semantics/model/semantics/metric_lookup.py index 213deaaad9..ca2b01eadb 100644 --- a/metricflow-semantics/metricflow_semantics/model/semantics/metric_lookup.py +++ b/metricflow-semantics/metricflow_semantics/model/semantics/metric_lookup.py @@ -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, @@ -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, @@ -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],