diff --git a/metricflow/plan_conversion/dataflow_to_sql.py b/metricflow/plan_conversion/dataflow_to_sql.py index 0294e75926..05895e7a81 100644 --- a/metricflow/plan_conversion/dataflow_to_sql.py +++ b/metricflow/plan_conversion/dataflow_to_sql.py @@ -53,7 +53,7 @@ from metricflow.model.semantic_manifest_lookup import SemanticManifestLookup from metricflow.plan_conversion.convert_to_sql_plan import ConvertToSqlPlanResult from metricflow.plan_conversion.instance_converters import ( - AddGroupByMetrics, + AddGroupByMetric, AddLinkToLinkableElements, AddMetadata, AddMetrics, @@ -740,7 +740,7 @@ def visit_compute_metrics_node(self, node: ComputeMetricsNode) -> SqlDataSet: metric_subquery_entity_links=entity_instance.spec.entity_links, ), ) - transform_func = AddGroupByMetrics([group_by_metric_instance]) + transform_func = AddGroupByMetric(group_by_metric_instance) output_instance_set = output_instance_set.transform(transform_func) diff --git a/metricflow/plan_conversion/instance_converters.py b/metricflow/plan_conversion/instance_converters.py index e7c4b60a4f..66180b4064 100644 --- a/metricflow/plan_conversion/instance_converters.py +++ b/metricflow/plan_conversion/instance_converters.py @@ -745,11 +745,11 @@ def transform(self, instance_set: InstanceSet) -> InstanceSet: # noqa: D102 ) -class AddGroupByMetrics(InstanceSetTransform[InstanceSet]): +class AddGroupByMetric(InstanceSetTransform[InstanceSet]): """Adds the given metric instances to the instance set.""" - def __init__(self, group_by_metric_instances: List[GroupByMetricInstance]) -> None: # noqa: D107 - self._group_by_metric_instances = group_by_metric_instances + def __init__(self, group_by_metric_instance: GroupByMetricInstance) -> None: # noqa: D107 + self._group_by_metric_instance = group_by_metric_instance def transform(self, instance_set: InstanceSet) -> InstanceSet: # noqa: D102 return InstanceSet( @@ -757,7 +757,7 @@ def transform(self, instance_set: InstanceSet) -> InstanceSet: # noqa: D102 dimension_instances=instance_set.dimension_instances, time_dimension_instances=instance_set.time_dimension_instances, entity_instances=instance_set.entity_instances, - group_by_metric_instances=instance_set.group_by_metric_instances + tuple(self._group_by_metric_instances), + group_by_metric_instances=instance_set.group_by_metric_instances + (self._group_by_metric_instance,), metric_instances=instance_set.metric_instances, metadata_instances=instance_set.metadata_instances, )