From 15c7cbf7218af5ca857aa7434bfe732aeb6fa8db Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Wed, 11 Dec 2024 13:20:28 -0800 Subject: [PATCH] Remove custom merge_iterable. --- metricflow/sql/sql_exprs.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/metricflow/sql/sql_exprs.py b/metricflow/sql/sql_exprs.py index 9c0a0674d..bde085260 100644 --- a/metricflow/sql/sql_exprs.py +++ b/metricflow/sql/sql_exprs.py @@ -6,9 +6,8 @@ from abc import ABC, abstractmethod from dataclasses import dataclass from enum import Enum -from typing import Dict, Generic, Iterable, List, Mapping, Optional, Sequence, Tuple +from typing import Dict, Generic, List, Mapping, Optional, Sequence, Tuple -import more_itertools from dbt_semantic_interfaces.enum_extension import assert_values_exhausted from dbt_semantic_interfaces.protocols.measure import MeasureAggregationParameters from dbt_semantic_interfaces.type_enums.aggregation_type import AggregationType @@ -110,20 +109,6 @@ class SqlExpressionTreeLineage(Mergeable): column_alias_reference_exprs: Tuple[SqlColumnAliasReferenceExpression, ...] = () other_exprs: Tuple[SqlExpressionNode, ...] = () - @classmethod - @override - def merge_iterable(cls, items: Iterable[SqlExpressionTreeLineage]) -> SqlExpressionTreeLineage: - """Combine multiple lineages into one lineage, without de-duping.""" - return SqlExpressionTreeLineage( - string_exprs=tuple(more_itertools.flatten(tuple(x.string_exprs for x in items))), - function_exprs=tuple(more_itertools.flatten(tuple(x.function_exprs for x in items))), - column_reference_exprs=tuple(more_itertools.flatten(tuple(x.column_reference_exprs for x in items))), - column_alias_reference_exprs=tuple( - more_itertools.flatten(tuple(x.column_alias_reference_exprs for x in items)) - ), - other_exprs=tuple(more_itertools.flatten(tuple(x.other_exprs for x in items))), - ) - @property def contains_string_exprs(self) -> bool: # noqa: D102 return len(self.string_exprs) > 0