From 657993f98f94c069615efda9a310ff30ab6c09f3 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Mon, 9 Dec 2024 11:14:33 -0800 Subject: [PATCH] Feedback: use Sequence type --- metricflow-semantics/metricflow_semantics/instances.py | 4 ++-- .../metricflow_semantics/specs/time_dimension_spec.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/metricflow-semantics/metricflow_semantics/instances.py b/metricflow-semantics/metricflow_semantics/instances.py index a2cf68307..bc4e5ae7b 100644 --- a/metricflow-semantics/metricflow_semantics/instances.py +++ b/metricflow-semantics/metricflow_semantics/instances.py @@ -145,10 +145,10 @@ def with_entity_prefix( spec=transformed_spec, ) - def with_new_defined_from(self, defined_from: Tuple[SemanticModelElementReference, ...]) -> TimeDimensionInstance: + def with_new_defined_from(self, defined_from: Sequence[SemanticModelElementReference]) -> TimeDimensionInstance: """Returns a new instance with the defined_from field replaced.""" return TimeDimensionInstance( - associated_columns=self.associated_columns, defined_from=defined_from, spec=self.spec + associated_columns=self.associated_columns, defined_from=tuple(defined_from), spec=self.spec ) diff --git a/metricflow-semantics/metricflow_semantics/specs/time_dimension_spec.py b/metricflow-semantics/metricflow_semantics/specs/time_dimension_spec.py index 6ccd56966..9c9637cf4 100644 --- a/metricflow-semantics/metricflow_semantics/specs/time_dimension_spec.py +++ b/metricflow-semantics/metricflow_semantics/specs/time_dimension_spec.py @@ -246,7 +246,7 @@ def with_entity_prefix(self, entity_prefix: EntityReference) -> TimeDimensionSpe ) @staticmethod - def with_base_grains(time_dimension_specs: Sequence[TimeDimensionSpec]) -> List[TimeDimensionSpec]: + def with_base_grains(time_dimension_specs: Sequence[TimeDimensionSpec]) -> Sequence[TimeDimensionSpec]: """Return the list of time dimension specs, replacing any custom grains with base grains. Dedupes new specs, but preserves the initial order.