diff --git a/metricflow-semantics/metricflow_semantics/instances.py b/metricflow-semantics/metricflow_semantics/instances.py index 3b64d90743..155fa3667c 100644 --- a/metricflow-semantics/metricflow_semantics/instances.py +++ b/metricflow-semantics/metricflow_semantics/instances.py @@ -11,17 +11,15 @@ from metricflow_semantics.aggregation_properties import AggregationState from metricflow_semantics.specs.column_assoc import ColumnAssociation -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - EntitySpec, - GroupByMetricSpec, - InstanceSpec, - MeasureSpec, - MetadataSpec, - MetricSpec, - TimeDimensionSpec, -) +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.entity_spec import EntitySpec +from metricflow_semantics.specs.group_by_metric_spec import GroupByMetricSpec +from metricflow_semantics.specs.instance_spec import InstanceSpec +from metricflow_semantics.specs.measure_spec import MeasureSpec +from metricflow_semantics.specs.metadata_spec import MetadataSpec +from metricflow_semantics.specs.metric_spec import MetricSpec from metricflow_semantics.specs.spec_set import InstanceSpecSet +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec # Type for the specification used in the instance. SpecT = TypeVar("SpecT", bound=InstanceSpec) diff --git a/metricflow-semantics/metricflow_semantics/model/semantics/linkable_element_set.py b/metricflow-semantics/metricflow_semantics/model/semantics/linkable_element_set.py index 378719f45f..40fca4a9c8 100644 --- a/metricflow-semantics/metricflow_semantics/model/semantics/linkable_element_set.py +++ b/metricflow-semantics/metricflow_semantics/model/semantics/linkable_element_set.py @@ -20,15 +20,12 @@ LinkableEntity, LinkableMetric, ) +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.entity_spec import EntitySpec +from metricflow_semantics.specs.group_by_metric_spec import GroupByMetricSpec +from metricflow_semantics.specs.instance_spec import InstanceSpec, LinkableInstanceSpec from metricflow_semantics.specs.patterns.spec_pattern import SpecPattern -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - EntitySpec, - GroupByMetricSpec, - InstanceSpec, - LinkableInstanceSpec, - TimeDimensionSpec, -) +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec logger = logging.getLogger(__name__) diff --git a/metricflow-semantics/metricflow_semantics/model/semantics/linkable_spec_resolver.py b/metricflow-semantics/metricflow_semantics/model/semantics/linkable_spec_resolver.py index f6892ee78e..2e6d308cf8 100644 --- a/metricflow-semantics/metricflow_semantics/model/semantics/linkable_spec_resolver.py +++ b/metricflow-semantics/metricflow_semantics/model/semantics/linkable_spec_resolver.py @@ -11,6 +11,7 @@ from dbt_semantic_interfaces.protocols.semantic_manifest import SemanticManifest from dbt_semantic_interfaces.protocols.semantic_model import SemanticModel from dbt_semantic_interfaces.references import ( + EntityReference, MeasureReference, MetricReference, SemanticModelReference, @@ -38,10 +39,7 @@ ) from metricflow_semantics.model.semantics.linkable_element_set import LinkableElementSet from metricflow_semantics.model.semantics.semantic_model_join_evaluator import SemanticModelJoinEvaluator -from metricflow_semantics.specs.spec_classes import ( - DEFAULT_TIME_GRANULARITY, - EntityReference, -) +from metricflow_semantics.specs.time_dimension_spec import DEFAULT_TIME_GRANULARITY if TYPE_CHECKING: from metricflow_semantics.model.semantics.semantic_model_lookup import SemanticModelLookup diff --git a/metricflow-semantics/metricflow_semantics/model/semantics/metric_lookup.py b/metricflow-semantics/metricflow_semantics/model/semantics/metric_lookup.py index 21e5fb8ac1..b46be1214a 100644 --- a/metricflow-semantics/metricflow_semantics/model/semantics/metric_lookup.py +++ b/metricflow-semantics/metricflow_semantics/model/semantics/metric_lookup.py @@ -19,7 +19,7 @@ ) from metricflow_semantics.model.semantics.semantic_model_join_evaluator import MAX_JOIN_HOPS from metricflow_semantics.model.semantics.semantic_model_lookup import SemanticModelLookup -from metricflow_semantics.specs.spec_classes import TimeDimensionSpec +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec logger = logging.getLogger(__name__) diff --git a/metricflow-semantics/metricflow_semantics/model/semantics/semantic_model_lookup.py b/metricflow-semantics/metricflow_semantics/model/semantics/semantic_model_lookup.py index 0fbc1b0c21..a7a5a04737 100644 --- a/metricflow-semantics/metricflow_semantics/model/semantics/semantic_model_lookup.py +++ b/metricflow-semantics/metricflow_semantics/model/semantics/semantic_model_lookup.py @@ -24,15 +24,12 @@ from metricflow_semantics.mf_logging.pretty_print import mf_pformat from metricflow_semantics.model.semantics.element_group import ElementGrouper from metricflow_semantics.model.spec_converters import MeasureConverter -from metricflow_semantics.specs.spec_classes import ( - DEFAULT_TIME_GRANULARITY, - DimensionSpec, - EntitySpec, - LinkableInstanceSpec, - MeasureSpec, - NonAdditiveDimensionSpec, - TimeDimensionSpec, -) +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.entity_spec import EntitySpec +from metricflow_semantics.specs.instance_spec import LinkableInstanceSpec +from metricflow_semantics.specs.measure_spec import MeasureSpec +from metricflow_semantics.specs.non_additive_dimension_spec import NonAdditiveDimensionSpec +from metricflow_semantics.specs.time_dimension_spec import DEFAULT_TIME_GRANULARITY, TimeDimensionSpec logger = logging.getLogger(__name__) diff --git a/metricflow-semantics/metricflow_semantics/model/spec_converters.py b/metricflow-semantics/metricflow_semantics/model/spec_converters.py index 2db2d7e519..88cd1d9f9e 100644 --- a/metricflow-semantics/metricflow_semantics/model/spec_converters.py +++ b/metricflow-semantics/metricflow_semantics/model/spec_converters.py @@ -12,10 +12,8 @@ from dbt_semantic_interfaces.protocols.measure import Measure -from metricflow_semantics.specs.spec_classes import ( - MeasureSpec, - NonAdditiveDimensionSpec, -) +from metricflow_semantics.specs.measure_spec import MeasureSpec +from metricflow_semantics.specs.non_additive_dimension_spec import NonAdditiveDimensionSpec class MeasureConverter: diff --git a/metricflow-semantics/metricflow_semantics/naming/dunder_scheme.py b/metricflow-semantics/metricflow_semantics/naming/dunder_scheme.py index 992b87d2f2..8f1424a8cb 100644 --- a/metricflow-semantics/metricflow_semantics/naming/dunder_scheme.py +++ b/metricflow-semantics/metricflow_semantics/naming/dunder_scheme.py @@ -10,14 +10,12 @@ from typing_extensions import override from metricflow_semantics.naming.naming_scheme import QueryItemNamingScheme +from metricflow_semantics.specs.instance_spec import InstanceSpec from metricflow_semantics.specs.patterns.entity_link_pattern import ( EntityLinkPattern, EntityLinkPatternParameterSet, ParameterSetField, ) -from metricflow_semantics.specs.spec_classes import ( - InstanceSpec, -) from metricflow_semantics.specs.spec_set import InstanceSpecSet, InstanceSpecSetTransform, group_spec_by_type diff --git a/metricflow-semantics/metricflow_semantics/naming/metric_scheme.py b/metricflow-semantics/metricflow_semantics/naming/metric_scheme.py index 92015b4fa7..0473cd44ce 100644 --- a/metricflow-semantics/metricflow_semantics/naming/metric_scheme.py +++ b/metricflow-semantics/metricflow_semantics/naming/metric_scheme.py @@ -6,10 +6,8 @@ from typing_extensions import override from metricflow_semantics.naming.naming_scheme import QueryItemNamingScheme +from metricflow_semantics.specs.instance_spec import InstanceSpec from metricflow_semantics.specs.patterns.metric_pattern import MetricSpecPattern -from metricflow_semantics.specs.spec_classes import ( - InstanceSpec, -) from metricflow_semantics.specs.spec_set import group_spec_by_type diff --git a/metricflow-semantics/metricflow_semantics/naming/naming_scheme.py b/metricflow-semantics/metricflow_semantics/naming/naming_scheme.py index 75331d5894..950ceaf680 100644 --- a/metricflow-semantics/metricflow_semantics/naming/naming_scheme.py +++ b/metricflow-semantics/metricflow_semantics/naming/naming_scheme.py @@ -6,7 +6,7 @@ from metricflow_semantics.specs.patterns.spec_pattern import SpecPattern if TYPE_CHECKING: - from metricflow_semantics.specs.spec_classes import InstanceSpec + from metricflow_semantics.specs.instance_spec import InstanceSpec class QueryItemNamingScheme(ABC): diff --git a/metricflow-semantics/metricflow_semantics/naming/object_builder_scheme.py b/metricflow-semantics/metricflow_semantics/naming/object_builder_scheme.py index fdf472b225..eef087c533 100644 --- a/metricflow-semantics/metricflow_semantics/naming/object_builder_scheme.py +++ b/metricflow-semantics/metricflow_semantics/naming/object_builder_scheme.py @@ -14,6 +14,7 @@ from metricflow_semantics.naming.naming_scheme import QueryItemNamingScheme from metricflow_semantics.naming.object_builder_str import ObjectBuilderNameConverter +from metricflow_semantics.specs.instance_spec import InstanceSpec from metricflow_semantics.specs.patterns.entity_link_pattern import ( EntityLinkPattern, EntityLinkPatternParameterSet, @@ -21,9 +22,6 @@ ) from metricflow_semantics.specs.patterns.spec_pattern import SpecPattern from metricflow_semantics.specs.patterns.typed_patterns import DimensionPattern, TimeDimensionPattern -from metricflow_semantics.specs.spec_classes import ( - InstanceSpec, -) logger = logging.getLogger(__name__) diff --git a/metricflow-semantics/metricflow_semantics/naming/object_builder_str.py b/metricflow-semantics/metricflow_semantics/naming/object_builder_str.py index d1bd3453de..75095ed56f 100644 --- a/metricflow-semantics/metricflow_semantics/naming/object_builder_str.py +++ b/metricflow-semantics/metricflow_semantics/naming/object_builder_str.py @@ -14,7 +14,7 @@ from dbt_semantic_interfaces.type_enums.date_part import DatePart from typing_extensions import override -from metricflow_semantics.specs.spec_classes import InstanceSpec +from metricflow_semantics.specs.instance_spec import InstanceSpec from metricflow_semantics.specs.spec_set import InstanceSpecSet, InstanceSpecSetTransform, group_spec_by_type diff --git a/metricflow-semantics/metricflow_semantics/query/group_by_item/candidate_push_down/group_by_item_candidate.py b/metricflow-semantics/metricflow_semantics/query/group_by_item/candidate_push_down/group_by_item_candidate.py index edecad3525..57022288d7 100644 --- a/metricflow-semantics/metricflow_semantics/query/group_by_item/candidate_push_down/group_by_item_candidate.py +++ b/metricflow-semantics/metricflow_semantics/query/group_by_item/candidate_push_down/group_by_item_candidate.py @@ -12,8 +12,8 @@ from metricflow_semantics.model.semantics.linkable_element_set import LinkableElementSet from metricflow_semantics.query.group_by_item.path_prefixable import PathPrefixable from metricflow_semantics.query.group_by_item.resolution_path import MetricFlowQueryResolutionPath +from metricflow_semantics.specs.instance_spec import LinkableInstanceSpec from metricflow_semantics.specs.patterns.spec_pattern import SpecPattern -from metricflow_semantics.specs.spec_classes import LinkableInstanceSpec logger = logging.getLogger(__name__) diff --git a/metricflow-semantics/metricflow_semantics/query/group_by_item/filter_spec_resolution/filter_spec_lookup.py b/metricflow-semantics/metricflow_semantics/query/group_by_item/filter_spec_resolution/filter_spec_lookup.py index 63846a3385..926e3cb0e9 100644 --- a/metricflow-semantics/metricflow_semantics/query/group_by_item/filter_spec_resolution/filter_spec_lookup.py +++ b/metricflow-semantics/metricflow_semantics/query/group_by_item/filter_spec_resolution/filter_spec_lookup.py @@ -26,7 +26,7 @@ if TYPE_CHECKING: from metricflow_semantics.model.semantics.linkable_element_set import LinkableElementSet - from metricflow_semantics.specs.spec_classes import LinkableInstanceSpec + from metricflow_semantics.specs.instance_spec import LinkableInstanceSpec logger = logging.getLogger(__name__) diff --git a/metricflow-semantics/metricflow_semantics/query/group_by_item/group_by_item_resolver.py b/metricflow-semantics/metricflow_semantics/query/group_by_item/group_by_item_resolver.py index 5bf9b98d16..0381da30a6 100644 --- a/metricflow-semantics/metricflow_semantics/query/group_by_item/group_by_item_resolver.py +++ b/metricflow-semantics/metricflow_semantics/query/group_by_item/group_by_item_resolver.py @@ -27,11 +27,11 @@ MetricFlowQueryResolutionIssueSet, ) from metricflow_semantics.query.suggestion_generator import QueryItemSuggestionGenerator +from metricflow_semantics.specs.instance_spec import LinkableInstanceSpec from metricflow_semantics.specs.patterns.minimum_time_grain import MinimumTimeGrainPattern from metricflow_semantics.specs.patterns.no_group_by_metric import NoGroupByMetricPattern from metricflow_semantics.specs.patterns.spec_pattern import SpecPattern from metricflow_semantics.specs.patterns.typed_patterns import TimeDimensionPattern -from metricflow_semantics.specs.spec_classes import LinkableInstanceSpec from metricflow_semantics.specs.spec_set import InstanceSpecSet, group_specs_by_type logger = logging.getLogger(__name__) diff --git a/metricflow-semantics/metricflow_semantics/query/issues/group_by_item_resolver/invalid_use_of_date_part.py b/metricflow-semantics/metricflow_semantics/query/issues/group_by_item_resolver/invalid_use_of_date_part.py index a53f178efe..52aeb0b860 100644 --- a/metricflow-semantics/metricflow_semantics/query/issues/group_by_item_resolver/invalid_use_of_date_part.py +++ b/metricflow-semantics/metricflow_semantics/query/issues/group_by_item_resolver/invalid_use_of_date_part.py @@ -12,7 +12,7 @@ MetricFlowQueryResolutionIssue, ) from metricflow_semantics.query.resolver_inputs.base_resolver_inputs import MetricFlowQueryResolverInput -from metricflow_semantics.specs.spec_classes import LinkableInstanceSpec +from metricflow_semantics.specs.instance_spec import LinkableInstanceSpec @dataclass(frozen=True) diff --git a/metricflow-semantics/metricflow_semantics/query/query_parser.py b/metricflow-semantics/metricflow_semantics/query/query_parser.py index fbcb896a04..4233ce89c2 100644 --- a/metricflow-semantics/metricflow_semantics/query/query_parser.py +++ b/metricflow-semantics/metricflow_semantics/query/query_parser.py @@ -52,17 +52,15 @@ ResolverInputForQuery, ResolverInputForQueryLevelWhereFilterIntersection, ) +from metricflow_semantics.specs.group_by_metric_spec import GroupByMetricSpec +from metricflow_semantics.specs.instance_spec import InstanceSpec from metricflow_semantics.specs.patterns.metric_time_pattern import MetricTimePattern from metricflow_semantics.specs.patterns.minimum_time_grain import MinimumTimeGrainPattern from metricflow_semantics.specs.patterns.none_date_part import NoneDatePartPattern from metricflow_semantics.specs.query_param_implementations import DimensionOrEntityParameter, MetricParameter from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec -from metricflow_semantics.specs.spec_classes import ( - GroupByMetricSpec, - InstanceSpec, - TimeDimensionSpec, -) from metricflow_semantics.specs.spec_set import group_specs_by_type +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from metricflow_semantics.time.dateutil_adjuster import DateutilTimePeriodAdjuster logger = logging.getLogger(__name__) diff --git a/metricflow-semantics/metricflow_semantics/query/query_resolver.py b/metricflow-semantics/metricflow_semantics/query/query_resolver.py index d91ed9c17b..d04af1ebfa 100644 --- a/metricflow-semantics/metricflow_semantics/query/query_resolver.py +++ b/metricflow-semantics/metricflow_semantics/query/query_resolver.py @@ -54,14 +54,11 @@ ) from metricflow_semantics.query.suggestion_generator import QueryItemSuggestionGenerator from metricflow_semantics.query.validation_rules.query_validator import PostResolutionQueryValidator +from metricflow_semantics.specs.instance_spec import InstanceSpec, LinkableInstanceSpec +from metricflow_semantics.specs.metric_spec import MetricSpec +from metricflow_semantics.specs.order_by_spec import OrderBySpec from metricflow_semantics.specs.patterns.match_list_pattern import MatchListSpecPattern from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec -from metricflow_semantics.specs.spec_classes import ( - InstanceSpec, - LinkableInstanceSpec, - MetricSpec, - OrderBySpec, -) from metricflow_semantics.specs.spec_set import group_specs_by_type from metricflow_semantics.workarounds.reference import sorted_semantic_model_references diff --git a/metricflow-semantics/metricflow_semantics/query/suggestion_generator.py b/metricflow-semantics/metricflow_semantics/query/suggestion_generator.py index e9744e33f2..1ebea20101 100644 --- a/metricflow-semantics/metricflow_semantics/query/suggestion_generator.py +++ b/metricflow-semantics/metricflow_semantics/query/suggestion_generator.py @@ -5,11 +5,11 @@ from metricflow_semantics.naming.naming_scheme import QueryItemNamingScheme from metricflow_semantics.query.similarity import top_fuzzy_matches +from metricflow_semantics.specs.instance_spec import InstanceSpec from metricflow_semantics.specs.patterns.minimum_time_grain import MinimumTimeGrainPattern from metricflow_semantics.specs.patterns.no_group_by_metric import NoGroupByMetricPattern from metricflow_semantics.specs.patterns.none_date_part import NoneDatePartPattern from metricflow_semantics.specs.patterns.spec_pattern import SpecPattern -from metricflow_semantics.specs.spec_classes import InstanceSpec logger = logging.getLogger(__name__) diff --git a/metricflow-semantics/metricflow_semantics/query/validation_rules/metric_time_requirements.py b/metricflow-semantics/metricflow_semantics/query/validation_rules/metric_time_requirements.py index 4d8ac2d8f1..0b3d47bc64 100644 --- a/metricflow-semantics/metricflow_semantics/query/validation_rules/metric_time_requirements.py +++ b/metricflow-semantics/metricflow_semantics/query/validation_rules/metric_time_requirements.py @@ -20,7 +20,7 @@ ) from metricflow_semantics.query.resolver_inputs.query_resolver_inputs import ResolverInputForQuery from metricflow_semantics.query.validation_rules.base_validation_rule import PostResolutionQueryValidationRule -from metricflow_semantics.specs.spec_classes import TimeDimensionSpec +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec class MetricTimeQueryValidationRule(PostResolutionQueryValidationRule): diff --git a/metricflow-semantics/metricflow_semantics/specs/column_assoc.py b/metricflow-semantics/metricflow_semantics/specs/column_assoc.py index 548945f868..363ea777c9 100644 --- a/metricflow-semantics/metricflow_semantics/specs/column_assoc.py +++ b/metricflow-semantics/metricflow_semantics/specs/column_assoc.py @@ -6,7 +6,7 @@ from dbt_semantic_interfaces.dataclass_serialization import SerializableDataclass -from metricflow_semantics.specs.spec_classes import InstanceSpec +from metricflow_semantics.specs.instance_spec import InstanceSpec class ColumnCorrelationKey(ABC): diff --git a/metricflow-semantics/metricflow_semantics/specs/constant_property_spec.py b/metricflow-semantics/metricflow_semantics/specs/constant_property_spec.py index e69de29bb2..e93c0b1980 100644 --- a/metricflow-semantics/metricflow_semantics/specs/constant_property_spec.py +++ b/metricflow-semantics/metricflow_semantics/specs/constant_property_spec.py @@ -0,0 +1,15 @@ +from __future__ import annotations + +from dataclasses import dataclass + +from dbt_semantic_interfaces.dataclass_serialization import SerializableDataclass + +from metricflow_semantics.specs.instance_spec import LinkableInstanceSpec + + +@dataclass(frozen=True) +class ConstantPropertySpec(SerializableDataclass): + """Includes the specs that are joined for conversion metric's constant properties.""" + + base_spec: LinkableInstanceSpec + conversion_spec: LinkableInstanceSpec diff --git a/metricflow-semantics/metricflow_semantics/specs/dimension_spec_resolver.py b/metricflow-semantics/metricflow_semantics/specs/dimension_spec_resolver.py index 752e64b300..238a305d62 100644 --- a/metricflow-semantics/metricflow_semantics/specs/dimension_spec_resolver.py +++ b/metricflow-semantics/metricflow_semantics/specs/dimension_spec_resolver.py @@ -12,7 +12,8 @@ from dbt_semantic_interfaces.type_enums import TimeGranularity from dbt_semantic_interfaces.type_enums.date_part import DatePart -from metricflow_semantics.specs.spec_classes import DEFAULT_TIME_GRANULARITY, DimensionSpec, TimeDimensionSpec +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.time_dimension_spec import DEFAULT_TIME_GRANULARITY, TimeDimensionSpec class DimensionSpecResolver: diff --git a/metricflow-semantics/metricflow_semantics/specs/dunder_column_association_resolver.py b/metricflow-semantics/metricflow_semantics/specs/dunder_column_association_resolver.py index 7fdda630fd..3473618c74 100644 --- a/metricflow-semantics/metricflow_semantics/specs/dunder_column_association_resolver.py +++ b/metricflow-semantics/metricflow_semantics/specs/dunder_column_association_resolver.py @@ -6,17 +6,14 @@ ColumnAssociation, ColumnAssociationResolver, ) -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - EntitySpec, - GroupByMetricSpec, - InstanceSpec, - InstanceSpecVisitor, - MeasureSpec, - MetadataSpec, - MetricSpec, - TimeDimensionSpec, -) +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.entity_spec import EntitySpec +from metricflow_semantics.specs.group_by_metric_spec import GroupByMetricSpec +from metricflow_semantics.specs.instance_spec import InstanceSpec, InstanceSpecVisitor +from metricflow_semantics.specs.measure_spec import MeasureSpec +from metricflow_semantics.specs.metadata_spec import MetadataSpec +from metricflow_semantics.specs.metric_spec import MetricSpec +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec class DunderColumnAssociationResolver(ColumnAssociationResolver): diff --git a/metricflow-semantics/metricflow_semantics/specs/linkable_spec_set.py b/metricflow-semantics/metricflow_semantics/specs/linkable_spec_set.py index 236172d8ab..83405298bd 100644 --- a/metricflow-semantics/metricflow_semantics/specs/linkable_spec_set.py +++ b/metricflow-semantics/metricflow_semantics/specs/linkable_spec_set.py @@ -10,15 +10,12 @@ from typing_extensions import override from metricflow_semantics.collection_helpers.merger import Mergeable -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - EntitySpec, - GroupByMetricSpec, - InstanceSpec, - LinkableInstanceSpec, - TimeDimensionSpec, -) +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.entity_spec import EntitySpec +from metricflow_semantics.specs.group_by_metric_spec import GroupByMetricSpec +from metricflow_semantics.specs.instance_spec import InstanceSpec, LinkableInstanceSpec from metricflow_semantics.specs.spec_set import InstanceSpecSet +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec if typing.TYPE_CHECKING: from metricflow_semantics.model.semantics.metric_lookup import MetricLookup diff --git a/metricflow-semantics/metricflow_semantics/specs/partition_spec_set.py b/metricflow-semantics/metricflow_semantics/specs/partition_spec_set.py index 51b598b764..231e6a43e9 100644 --- a/metricflow-semantics/metricflow_semantics/specs/partition_spec_set.py +++ b/metricflow-semantics/metricflow_semantics/specs/partition_spec_set.py @@ -5,7 +5,8 @@ from dbt_semantic_interfaces.dataclass_serialization import SerializableDataclass -from metricflow_semantics.specs.spec_classes import DimensionSpec, TimeDimensionSpec +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec @dataclass(frozen=True) diff --git a/metricflow-semantics/metricflow_semantics/specs/patterns/entity_link_pattern.py b/metricflow-semantics/metricflow_semantics/specs/patterns/entity_link_pattern.py index b57d4ef1cf..72034d65c1 100644 --- a/metricflow-semantics/metricflow_semantics/specs/patterns/entity_link_pattern.py +++ b/metricflow-semantics/metricflow_semantics/specs/patterns/entity_link_pattern.py @@ -11,8 +11,8 @@ from more_itertools import is_sorted from typing_extensions import override +from metricflow_semantics.specs.instance_spec import InstanceSpec, LinkableInstanceSpec from metricflow_semantics.specs.patterns.spec_pattern import SpecPattern -from metricflow_semantics.specs.spec_classes import InstanceSpec, LinkableInstanceSpec from metricflow_semantics.specs.spec_set import group_specs_by_type logger = logging.getLogger(__name__) diff --git a/metricflow-semantics/metricflow_semantics/specs/patterns/match_list_pattern.py b/metricflow-semantics/metricflow_semantics/specs/patterns/match_list_pattern.py index 07bf3e2553..ea57b2d36b 100644 --- a/metricflow-semantics/metricflow_semantics/specs/patterns/match_list_pattern.py +++ b/metricflow-semantics/metricflow_semantics/specs/patterns/match_list_pattern.py @@ -4,8 +4,8 @@ from typing_extensions import override +from metricflow_semantics.specs.instance_spec import InstanceSpec from metricflow_semantics.specs.patterns.spec_pattern import SpecPattern -from metricflow_semantics.specs.spec_classes import InstanceSpec class MatchListSpecPattern(SpecPattern): diff --git a/metricflow-semantics/metricflow_semantics/specs/patterns/metric_pattern.py b/metricflow-semantics/metricflow_semantics/specs/patterns/metric_pattern.py index 346b39234c..ef598890ea 100644 --- a/metricflow-semantics/metricflow_semantics/specs/patterns/metric_pattern.py +++ b/metricflow-semantics/metricflow_semantics/specs/patterns/metric_pattern.py @@ -6,11 +6,9 @@ from dbt_semantic_interfaces.references import MetricReference from typing_extensions import override +from metricflow_semantics.specs.instance_spec import InstanceSpec +from metricflow_semantics.specs.metric_spec import MetricSpec from metricflow_semantics.specs.patterns.spec_pattern import SpecPattern -from metricflow_semantics.specs.spec_classes import ( - InstanceSpec, - MetricSpec, -) from metricflow_semantics.specs.spec_set import group_specs_by_type diff --git a/metricflow-semantics/metricflow_semantics/specs/patterns/metric_time_pattern.py b/metricflow-semantics/metricflow_semantics/specs/patterns/metric_time_pattern.py index 4ef943a86d..9482c37cc3 100644 --- a/metricflow-semantics/metricflow_semantics/specs/patterns/metric_time_pattern.py +++ b/metricflow-semantics/metricflow_semantics/specs/patterns/metric_time_pattern.py @@ -5,12 +5,10 @@ from dbt_semantic_interfaces.naming.keywords import METRIC_TIME_ELEMENT_NAME from typing_extensions import override +from metricflow_semantics.specs.instance_spec import InstanceSpec from metricflow_semantics.specs.patterns.spec_pattern import SpecPattern -from metricflow_semantics.specs.spec_classes import ( - InstanceSpec, - TimeDimensionSpec, -) from metricflow_semantics.specs.spec_set import group_specs_by_type +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec class MetricTimePattern(SpecPattern): diff --git a/metricflow-semantics/metricflow_semantics/specs/patterns/min_time_grain.py b/metricflow-semantics/metricflow_semantics/specs/patterns/min_time_grain.py index f64a1e14f7..e54179b84f 100644 --- a/metricflow-semantics/metricflow_semantics/specs/patterns/min_time_grain.py +++ b/metricflow-semantics/metricflow_semantics/specs/patterns/min_time_grain.py @@ -6,15 +6,14 @@ from dbt_semantic_interfaces.type_enums import TimeGranularity from typing_extensions import override +from metricflow_semantics.specs.instance_spec import InstanceSpec, LinkableInstanceSpec from metricflow_semantics.specs.patterns.spec_pattern import SpecPattern -from metricflow_semantics.specs.spec_classes import ( - InstanceSpec, - LinkableInstanceSpec, +from metricflow_semantics.specs.spec_set import group_specs_by_type +from metricflow_semantics.specs.time_dimension_spec import ( TimeDimensionSpec, TimeDimensionSpecComparisonKey, TimeDimensionSpecField, ) -from metricflow_semantics.specs.spec_set import group_specs_by_type class MinimumTimeGrainPattern(SpecPattern): diff --git a/metricflow-semantics/metricflow_semantics/specs/patterns/no_group_by_metric.py b/metricflow-semantics/metricflow_semantics/specs/patterns/no_group_by_metric.py index 1cbeb1fed9..ffb2f62ec3 100644 --- a/metricflow-semantics/metricflow_semantics/specs/patterns/no_group_by_metric.py +++ b/metricflow-semantics/metricflow_semantics/specs/patterns/no_group_by_metric.py @@ -4,11 +4,8 @@ from typing_extensions import override +from metricflow_semantics.specs.instance_spec import InstanceSpec, LinkableInstanceSpec from metricflow_semantics.specs.patterns.spec_pattern import SpecPattern -from metricflow_semantics.specs.spec_classes import ( - InstanceSpec, - LinkableInstanceSpec, -) from metricflow_semantics.specs.spec_set import group_specs_by_type diff --git a/metricflow-semantics/metricflow_semantics/specs/patterns/none_date_part.py b/metricflow-semantics/metricflow_semantics/specs/patterns/none_date_part.py index 94879175d4..8046f6e263 100644 --- a/metricflow-semantics/metricflow_semantics/specs/patterns/none_date_part.py +++ b/metricflow-semantics/metricflow_semantics/specs/patterns/none_date_part.py @@ -4,11 +4,8 @@ from typing_extensions import override +from metricflow_semantics.specs.instance_spec import InstanceSpec, LinkableInstanceSpec from metricflow_semantics.specs.patterns.spec_pattern import SpecPattern -from metricflow_semantics.specs.spec_classes import ( - InstanceSpec, - LinkableInstanceSpec, -) from metricflow_semantics.specs.spec_set import group_specs_by_type diff --git a/metricflow-semantics/metricflow_semantics/specs/patterns/spec_pattern.py b/metricflow-semantics/metricflow_semantics/specs/patterns/spec_pattern.py index 7a9071f08b..7ad28d532b 100644 --- a/metricflow-semantics/metricflow_semantics/specs/patterns/spec_pattern.py +++ b/metricflow-semantics/metricflow_semantics/specs/patterns/spec_pattern.py @@ -4,7 +4,7 @@ from typing import TYPE_CHECKING, Sequence if TYPE_CHECKING: - from metricflow_semantics.specs.spec_classes import InstanceSpec + from metricflow_semantics.specs.instance_spec import InstanceSpec class SpecPattern(ABC): diff --git a/metricflow-semantics/metricflow_semantics/specs/patterns/typed_patterns.py b/metricflow-semantics/metricflow_semantics/specs/patterns/typed_patterns.py index 72a9349e37..22d46f3170 100644 --- a/metricflow-semantics/metricflow_semantics/specs/patterns/typed_patterns.py +++ b/metricflow-semantics/metricflow_semantics/specs/patterns/typed_patterns.py @@ -13,12 +13,12 @@ from typing_extensions import override from metricflow_semantics.naming.linkable_spec_name import StructuredLinkableSpecName +from metricflow_semantics.specs.instance_spec import InstanceSpec, LinkableInstanceSpec from metricflow_semantics.specs.patterns.entity_link_pattern import ( EntityLinkPattern, EntityLinkPatternParameterSet, ParameterSetField, ) -from metricflow_semantics.specs.spec_classes import InstanceSpec, LinkableInstanceSpec from metricflow_semantics.specs.spec_set import group_specs_by_type diff --git a/metricflow-semantics/metricflow_semantics/specs/query_spec.py b/metricflow-semantics/metricflow_semantics/specs/query_spec.py index be42f19bc1..4a47d7ac37 100644 --- a/metricflow-semantics/metricflow_semantics/specs/query_spec.py +++ b/metricflow-semantics/metricflow_semantics/specs/query_spec.py @@ -10,15 +10,13 @@ from metricflow_semantics.query.group_by_item.filter_spec_resolution.filter_spec_lookup import ( FilterSpecResolutionLookUp, ) +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.entity_spec import EntitySpec +from metricflow_semantics.specs.group_by_metric_spec import GroupByMetricSpec from metricflow_semantics.specs.linkable_spec_set import LinkableSpecSet -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - EntitySpec, - GroupByMetricSpec, - MetricSpec, - OrderBySpec, - TimeDimensionSpec, -) +from metricflow_semantics.specs.metric_spec import MetricSpec +from metricflow_semantics.specs.order_by_spec import OrderBySpec +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec @dataclass(frozen=True) diff --git a/metricflow-semantics/metricflow_semantics/specs/rendered_spec_tracker.py b/metricflow-semantics/metricflow_semantics/specs/rendered_spec_tracker.py index 016d76f138..08e6e9c3cd 100644 --- a/metricflow-semantics/metricflow_semantics/specs/rendered_spec_tracker.py +++ b/metricflow-semantics/metricflow_semantics/specs/rendered_spec_tracker.py @@ -3,7 +3,7 @@ from typing import List, Sequence, Tuple from metricflow_semantics.model.semantics.linkable_element import LinkableElement -from metricflow_semantics.specs.spec_classes import LinkableInstanceSpec +from metricflow_semantics.specs.instance_spec import LinkableInstanceSpec class RenderedSpecTracker: diff --git a/metricflow-semantics/metricflow_semantics/specs/spec_set.py b/metricflow-semantics/metricflow_semantics/specs/spec_set.py index 8839af492d..0c87fc0872 100644 --- a/metricflow-semantics/metricflow_semantics/specs/spec_set.py +++ b/metricflow-semantics/metricflow_semantics/specs/spec_set.py @@ -10,18 +10,14 @@ from typing_extensions import override from metricflow_semantics.collection_helpers.merger import Mergeable -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - EntitySpec, - GroupByMetricSpec, - InstanceSpec, - InstanceSpecVisitor, - LinkableInstanceSpec, - MeasureSpec, - MetadataSpec, - MetricSpec, - TimeDimensionSpec, -) +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.entity_spec import EntitySpec +from metricflow_semantics.specs.group_by_metric_spec import GroupByMetricSpec +from metricflow_semantics.specs.instance_spec import InstanceSpec, InstanceSpecVisitor, LinkableInstanceSpec +from metricflow_semantics.specs.measure_spec import MeasureSpec +from metricflow_semantics.specs.metadata_spec import MetadataSpec +from metricflow_semantics.specs.metric_spec import MetricSpec +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec @dataclass(frozen=True) diff --git a/metricflow-semantics/metricflow_semantics/specs/where_filter/where_filter_transform.py b/metricflow-semantics/metricflow_semantics/specs/where_filter/where_filter_transform.py index 31bd80cbfc..82d862ec41 100644 --- a/metricflow-semantics/metricflow_semantics/specs/where_filter/where_filter_transform.py +++ b/metricflow-semantics/metricflow_semantics/specs/where_filter/where_filter_transform.py @@ -14,10 +14,10 @@ ) from metricflow_semantics.specs.column_assoc import ColumnAssociationResolver from metricflow_semantics.specs.rendered_spec_tracker import RenderedSpecTracker -from metricflow_semantics.specs.spec_classes import WhereFilterSpec from metricflow_semantics.specs.where_filter.where_filter_dimension import WhereFilterDimensionFactory from metricflow_semantics.specs.where_filter.where_filter_entity import WhereFilterEntityFactory from metricflow_semantics.specs.where_filter.where_filter_metric import WhereFilterMetricFactory +from metricflow_semantics.specs.where_filter.where_filter_spec import WhereFilterSpec from metricflow_semantics.specs.where_filter.where_filter_time_dimension import WhereFilterTimeDimensionFactory from metricflow_semantics.sql.sql_bind_parameters import SqlBindParameters diff --git a/metricflow-semantics/metricflow_semantics/test_helpers/metric_time_dimension.py b/metricflow-semantics/metricflow_semantics/test_helpers/metric_time_dimension.py index 93a2928b8c..090e5abd0e 100644 --- a/metricflow-semantics/metricflow_semantics/test_helpers/metric_time_dimension.py +++ b/metricflow-semantics/metricflow_semantics/test_helpers/metric_time_dimension.py @@ -4,7 +4,7 @@ from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity from dbt_semantic_interfaces.validations.unique_valid_name import MetricFlowReservedKeywords -from metricflow_semantics.specs.spec_classes import TimeDimensionSpec +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec # Shortcuts for referring to the metric time dimension. MTD = MetricFlowReservedKeywords.METRIC_TIME.value diff --git a/metricflow-semantics/tests_metricflow_semantics/model/semantics/test_linkable_element_set.py b/metricflow-semantics/tests_metricflow_semantics/model/semantics/test_linkable_element_set.py index cb28c1ef42..c769c5a293 100644 --- a/metricflow-semantics/tests_metricflow_semantics/model/semantics/test_linkable_element_set.py +++ b/metricflow-semantics/tests_metricflow_semantics/model/semantics/test_linkable_element_set.py @@ -39,7 +39,7 @@ EntityLinkPatternParameterSet, ParameterSetField, ) -from metricflow_semantics.specs.spec_classes import TimeDimensionSpec +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from more_itertools import bucket AMBIGUOUS_NAME = "ambiguous" diff --git a/metricflow-semantics/tests_metricflow_semantics/model/test_where_filter_spec.py b/metricflow-semantics/tests_metricflow_semantics/model/test_where_filter_spec.py index 9a961d6e08..41ce535132 100644 --- a/metricflow-semantics/tests_metricflow_semantics/model/test_where_filter_spec.py +++ b/metricflow-semantics/tests_metricflow_semantics/model/test_where_filter_spec.py @@ -48,15 +48,13 @@ from metricflow_semantics.query.group_by_item.resolution_path import MetricFlowQueryResolutionPath from metricflow_semantics.query.issues.issues_base import MetricFlowQueryResolutionIssueSet from metricflow_semantics.specs.column_assoc import ColumnAssociationResolver +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.entity_spec import EntitySpec +from metricflow_semantics.specs.group_by_metric_spec import GroupByMetricSpec +from metricflow_semantics.specs.instance_spec import LinkableInstanceSpec from metricflow_semantics.specs.linkable_spec_set import LinkableSpecSet -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - EntitySpec, - GroupByMetricSpec, - LinkableInstanceSpec, - TimeDimensionSpec, - WhereFilterSpec, -) +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec +from metricflow_semantics.specs.where_filter.where_filter_spec import WhereFilterSpec from metricflow_semantics.specs.where_filter.where_filter_transform import WhereSpecFactory from tests_metricflow_semantics.specs.conftest import EXAMPLE_FILTER_LOCATION diff --git a/metricflow-semantics/tests_metricflow_semantics/naming/conftest.py b/metricflow-semantics/tests_metricflow_semantics/naming/conftest.py index aa974295a0..90b63a1812 100644 --- a/metricflow-semantics/tests_metricflow_semantics/naming/conftest.py +++ b/metricflow-semantics/tests_metricflow_semantics/naming/conftest.py @@ -6,13 +6,11 @@ from dbt_semantic_interfaces.references import EntityReference from dbt_semantic_interfaces.type_enums import TimeGranularity from dbt_semantic_interfaces.type_enums.date_part import DatePart -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - EntitySpec, - GroupByMetricSpec, - LinkableInstanceSpec, - TimeDimensionSpec, -) +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.entity_spec import EntitySpec +from metricflow_semantics.specs.group_by_metric_spec import GroupByMetricSpec +from metricflow_semantics.specs.instance_spec import LinkableInstanceSpec +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from metricflow_semantics.test_helpers.metric_time_dimension import MTD_SPEC_MONTH, MTD_SPEC_WEEK, MTD_SPEC_YEAR diff --git a/metricflow-semantics/tests_metricflow_semantics/naming/test_dunder_naming_scheme.py b/metricflow-semantics/tests_metricflow_semantics/naming/test_dunder_naming_scheme.py index 99c329f034..4835a86265 100644 --- a/metricflow-semantics/tests_metricflow_semantics/naming/test_dunder_naming_scheme.py +++ b/metricflow-semantics/tests_metricflow_semantics/naming/test_dunder_naming_scheme.py @@ -7,7 +7,10 @@ from dbt_semantic_interfaces.type_enums import TimeGranularity from dbt_semantic_interfaces.type_enums.date_part import DatePart from metricflow_semantics.naming.dunder_scheme import DunderNamingScheme -from metricflow_semantics.specs.spec_classes import DimensionSpec, EntitySpec, LinkableInstanceSpec, TimeDimensionSpec +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.entity_spec import EntitySpec +from metricflow_semantics.specs.instance_spec import LinkableInstanceSpec +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from metricflow_semantics.test_helpers.metric_time_dimension import MTD_SPEC_MONTH, MTD_SPEC_WEEK, MTD_SPEC_YEAR diff --git a/metricflow-semantics/tests_metricflow_semantics/naming/test_metric_name_scheme.py b/metricflow-semantics/tests_metricflow_semantics/naming/test_metric_name_scheme.py index 6912c306a2..f4874abe24 100644 --- a/metricflow-semantics/tests_metricflow_semantics/naming/test_metric_name_scheme.py +++ b/metricflow-semantics/tests_metricflow_semantics/naming/test_metric_name_scheme.py @@ -4,7 +4,9 @@ import pytest from metricflow_semantics.naming.metric_scheme import MetricNamingScheme -from metricflow_semantics.specs.spec_classes import DimensionSpec, InstanceSpec, MetricSpec +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.instance_spec import InstanceSpec +from metricflow_semantics.specs.metric_spec import MetricSpec @pytest.fixture(scope="session") diff --git a/metricflow-semantics/tests_metricflow_semantics/naming/test_object_builder_naming_scheme.py b/metricflow-semantics/tests_metricflow_semantics/naming/test_object_builder_naming_scheme.py index df134aa1ef..209f6e51c7 100644 --- a/metricflow-semantics/tests_metricflow_semantics/naming/test_object_builder_naming_scheme.py +++ b/metricflow-semantics/tests_metricflow_semantics/naming/test_object_builder_naming_scheme.py @@ -7,13 +7,11 @@ from dbt_semantic_interfaces.type_enums import TimeGranularity from dbt_semantic_interfaces.type_enums.date_part import DatePart from metricflow_semantics.naming.object_builder_scheme import ObjectBuilderNamingScheme -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - EntitySpec, - GroupByMetricSpec, - LinkableInstanceSpec, - TimeDimensionSpec, -) +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.entity_spec import EntitySpec +from metricflow_semantics.specs.group_by_metric_spec import GroupByMetricSpec +from metricflow_semantics.specs.instance_spec import LinkableInstanceSpec +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from metricflow_semantics.test_helpers.metric_time_dimension import MTD_SPEC_MONTH, MTD_SPEC_WEEK, MTD_SPEC_YEAR diff --git a/metricflow-semantics/tests_metricflow_semantics/query/test_query_parser.py b/metricflow-semantics/tests_metricflow_semantics/query/test_query_parser.py index 79f1e57e34..0f30cb2537 100644 --- a/metricflow-semantics/tests_metricflow_semantics/query/test_query_parser.py +++ b/metricflow-semantics/tests_metricflow_semantics/query/test_query_parser.py @@ -17,15 +17,13 @@ from metricflow_semantics.model.semantic_manifest_lookup import SemanticManifestLookup from metricflow_semantics.query.query_exceptions import InvalidQueryException from metricflow_semantics.query.query_parser import MetricFlowQueryParser +from metricflow_semantics.specs.dimension_spec import DimensionSpec from metricflow_semantics.specs.query_param_implementations import ( DimensionOrEntityParameter, MetricParameter, OrderByParameter, TimeDimensionParameter, ) -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, -) from metricflow_semantics.test_helpers.config_helpers import MetricFlowTestConfiguration from metricflow_semantics.test_helpers.example_project_configuration import ( EXAMPLE_PROJECT_CONFIGURATION_YAML_CONFIG_FILE, diff --git a/metricflow-semantics/tests_metricflow_semantics/specs/patterns/test_entity_link_pattern.py b/metricflow-semantics/tests_metricflow_semantics/specs/patterns/test_entity_link_pattern.py index 882cce8d9c..617802cb41 100644 --- a/metricflow-semantics/tests_metricflow_semantics/specs/patterns/test_entity_link_pattern.py +++ b/metricflow-semantics/tests_metricflow_semantics/specs/patterns/test_entity_link_pattern.py @@ -9,18 +9,16 @@ from dbt_semantic_interfaces.references import EntityReference from dbt_semantic_interfaces.type_enums import TimeGranularity from dbt_semantic_interfaces.type_enums.date_part import DatePart +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.entity_spec import EntitySpec +from metricflow_semantics.specs.group_by_metric_spec import GroupByMetricSpec +from metricflow_semantics.specs.instance_spec import LinkableInstanceSpec from metricflow_semantics.specs.patterns.entity_link_pattern import ( EntityLinkPattern, EntityLinkPatternParameterSet, ParameterSetField, ) -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - EntitySpec, - GroupByMetricSpec, - LinkableInstanceSpec, - TimeDimensionSpec, -) +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from metricflow_semantics.test_helpers.metric_time_dimension import MTD_SPEC_MONTH, MTD_SPEC_WEEK, MTD_SPEC_YEAR logger = logging.getLogger(__name__) diff --git a/metricflow-semantics/tests_metricflow_semantics/specs/patterns/test_typed_patterns.py b/metricflow-semantics/tests_metricflow_semantics/specs/patterns/test_typed_patterns.py index 2b02555c20..f74e748669 100644 --- a/metricflow-semantics/tests_metricflow_semantics/specs/patterns/test_typed_patterns.py +++ b/metricflow-semantics/tests_metricflow_semantics/specs/patterns/test_typed_patterns.py @@ -18,19 +18,17 @@ ) from dbt_semantic_interfaces.type_enums import TimeGranularity from dbt_semantic_interfaces.type_enums.date_part import DatePart +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.entity_spec import EntitySpec +from metricflow_semantics.specs.group_by_metric_spec import GroupByMetricSpec +from metricflow_semantics.specs.instance_spec import LinkableInstanceSpec from metricflow_semantics.specs.patterns.typed_patterns import ( DimensionPattern, EntityPattern, GroupByMetricPattern, TimeDimensionPattern, ) -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - EntitySpec, - GroupByMetricSpec, - LinkableInstanceSpec, - TimeDimensionSpec, -) +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec logger = logging.getLogger(__name__) diff --git a/metricflow-semantics/tests_metricflow_semantics/specs/test_time_dimension_spec.py b/metricflow-semantics/tests_metricflow_semantics/specs/test_time_dimension_spec.py index 7bcba39570..1417025038 100644 --- a/metricflow-semantics/tests_metricflow_semantics/specs/test_time_dimension_spec.py +++ b/metricflow-semantics/tests_metricflow_semantics/specs/test_time_dimension_spec.py @@ -4,7 +4,7 @@ from dbt_semantic_interfaces.references import EntityReference from dbt_semantic_interfaces.type_enums import TimeGranularity -from metricflow_semantics.specs.spec_classes import TimeDimensionSpec, TimeDimensionSpecField +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec, TimeDimensionSpecField logger = logging.getLogger(__name__) diff --git a/metricflow-semantics/tests_metricflow_semantics/test_specs.py b/metricflow-semantics/tests_metricflow_semantics/test_specs.py index 9124c4fc51..85f31c2037 100644 --- a/metricflow-semantics/tests_metricflow_semantics/test_specs.py +++ b/metricflow-semantics/tests_metricflow_semantics/test_specs.py @@ -3,20 +3,16 @@ from typing import Sequence import pytest +from dbt_semantic_interfaces.references import EntityReference from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - EntityReference, - EntitySpec, - GroupByMetricSpec, - InstanceSpec, - LinkableInstanceSpec, - LinklessEntitySpec, - MeasureSpec, - MetricSpec, - TimeDimensionSpec, -) +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.entity_spec import EntitySpec, LinklessEntitySpec +from metricflow_semantics.specs.group_by_metric_spec import GroupByMetricSpec +from metricflow_semantics.specs.instance_spec import InstanceSpec, LinkableInstanceSpec +from metricflow_semantics.specs.measure_spec import MeasureSpec +from metricflow_semantics.specs.metric_spec import MetricSpec from metricflow_semantics.specs.spec_set import InstanceSpecSet +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec @pytest.fixture diff --git a/metricflow/dataflow/builder/dataflow_plan_builder.py b/metricflow/dataflow/builder/dataflow_plan_builder.py index f445d6dbae..03f8c9b6dd 100644 --- a/metricflow/dataflow/builder/dataflow_plan_builder.py +++ b/metricflow/dataflow/builder/dataflow_plan_builder.py @@ -31,25 +31,24 @@ FilterSpecResolutionLookUp, ) from metricflow_semantics.specs.column_assoc import ColumnAssociationResolver +from metricflow_semantics.specs.constant_property_spec import ConstantPropertySpec +from metricflow_semantics.specs.entity_spec import EntitySpec, LinklessEntitySpec +from metricflow_semantics.specs.instance_spec import LinkableInstanceSpec from metricflow_semantics.specs.linkable_spec_set import LinkableSpecSet -from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec -from metricflow_semantics.specs.spec_classes import ( - ConstantPropertySpec, +from metricflow_semantics.specs.measure_spec import ( CumulativeMeasureDescription, - EntitySpec, JoinToTimeSpineDescription, - LinkableInstanceSpec, - LinklessEntitySpec, MeasureSpec, - MetadataSpec, MetricInputMeasureSpec, - MetricSpec, - NonAdditiveDimensionSpec, - OrderBySpec, - TimeDimensionSpec, - WhereFilterSpec, ) +from metricflow_semantics.specs.metadata_spec import MetadataSpec +from metricflow_semantics.specs.metric_spec import MetricSpec +from metricflow_semantics.specs.non_additive_dimension_spec import NonAdditiveDimensionSpec +from metricflow_semantics.specs.order_by_spec import OrderBySpec +from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec from metricflow_semantics.specs.spec_set import InstanceSpecSet, group_specs_by_type +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec +from metricflow_semantics.specs.where_filter.where_filter_spec import WhereFilterSpec from metricflow_semantics.specs.where_filter.where_filter_transform import WhereSpecFactory from metricflow_semantics.sql.sql_join_type import SqlJoinType from metricflow_semantics.time.dateutil_adjuster import DateutilTimePeriodAdjuster diff --git a/metricflow/dataflow/builder/measure_additiveness.py b/metricflow/dataflow/builder/measure_additiveness.py index 2eb0c9a877..46f4562a21 100644 --- a/metricflow/dataflow/builder/measure_additiveness.py +++ b/metricflow/dataflow/builder/measure_additiveness.py @@ -4,7 +4,8 @@ from dataclasses import dataclass from typing import Dict, Optional, Sequence, Tuple -from metricflow_semantics.specs.spec_classes import MeasureSpec, NonAdditiveDimensionSpec +from metricflow_semantics.specs.measure_spec import MeasureSpec +from metricflow_semantics.specs.non_additive_dimension_spec import NonAdditiveDimensionSpec @dataclass(frozen=True) diff --git a/metricflow/dataflow/builder/node_evaluator.py b/metricflow/dataflow/builder/node_evaluator.py index 971425eee6..698651e397 100644 --- a/metricflow/dataflow/builder/node_evaluator.py +++ b/metricflow/dataflow/builder/node_evaluator.py @@ -26,10 +26,8 @@ from metricflow_semantics.mf_logging.pretty_print import mf_pformat from metricflow_semantics.model.semantics.semantic_model_join_evaluator import SemanticModelJoinEvaluator from metricflow_semantics.model.semantics.semantic_model_lookup import SemanticModelLookup -from metricflow_semantics.specs.spec_classes import ( - LinkableInstanceSpec, - LinklessEntitySpec, -) +from metricflow_semantics.specs.entity_spec import LinklessEntitySpec +from metricflow_semantics.specs.instance_spec import LinkableInstanceSpec from metricflow_semantics.specs.spec_set import group_specs_by_type from metricflow_semantics.sql.sql_join_type import SqlJoinType diff --git a/metricflow/dataflow/builder/partitions.py b/metricflow/dataflow/builder/partitions.py index 510a9fa4ec..599c8a7faa 100644 --- a/metricflow/dataflow/builder/partitions.py +++ b/metricflow/dataflow/builder/partitions.py @@ -5,12 +5,10 @@ from typing import List, Sequence, Tuple from metricflow_semantics.model.semantics.semantic_model_lookup import SemanticModelLookup +from metricflow_semantics.specs.dimension_spec import DimensionSpec from metricflow_semantics.specs.partition_spec_set import PartitionSpecSet -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - TimeDimensionSpec, -) from metricflow_semantics.specs.spec_set import InstanceSpecSet +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from metricflow.dataset.dataset_classes import DataSet diff --git a/metricflow/dataflow/builder/source_node.py b/metricflow/dataflow/builder/source_node.py index 0054f57bca..3e105a83fa 100644 --- a/metricflow/dataflow/builder/source_node.py +++ b/metricflow/dataflow/builder/source_node.py @@ -7,8 +7,8 @@ from metricflow_semantics.model.semantic_manifest_lookup import SemanticManifestLookup from metricflow_semantics.query.query_parser import MetricFlowQueryParser from metricflow_semantics.specs.column_assoc import ColumnAssociationResolver +from metricflow_semantics.specs.group_by_metric_spec import GroupByMetricSpec from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec -from metricflow_semantics.specs.spec_classes import GroupByMetricSpec from metricflow.dataflow.dataflow_plan import DataflowPlanNode from metricflow.dataflow.nodes.metric_time_transform import MetricTimeDimensionTransformNode diff --git a/metricflow/dataflow/dataflow_plan.py b/metricflow/dataflow/dataflow_plan.py index ba8c0c0a8e..e324fdd4bb 100644 --- a/metricflow/dataflow/dataflow_plan.py +++ b/metricflow/dataflow/dataflow_plan.py @@ -15,7 +15,7 @@ if typing.TYPE_CHECKING: from dbt_semantic_interfaces.references import SemanticModelReference - from metricflow_semantics.specs.spec_classes import LinkableInstanceSpec + from metricflow_semantics.specs.instance_spec import LinkableInstanceSpec from metricflow.dataflow.nodes.add_generated_uuid import AddGeneratedUuidColumnNode from metricflow.dataflow.nodes.aggregate_measures import AggregateMeasuresNode diff --git a/metricflow/dataflow/nodes/aggregate_measures.py b/metricflow/dataflow/nodes/aggregate_measures.py index 757ba6ec8b..9128f6a0a6 100644 --- a/metricflow/dataflow/nodes/aggregate_measures.py +++ b/metricflow/dataflow/nodes/aggregate_measures.py @@ -4,7 +4,7 @@ from typing import Sequence, Tuple from metricflow_semantics.dag.id_prefix import IdPrefix, StaticIdPrefix -from metricflow_semantics.specs.spec_classes import MetricInputMeasureSpec +from metricflow_semantics.specs.measure_spec import MetricInputMeasureSpec from metricflow_semantics.visitor import VisitorOutputT from metricflow.dataflow.dataflow_plan import DataflowPlanNode, DataflowPlanNodeVisitor diff --git a/metricflow/dataflow/nodes/compute_metrics.py b/metricflow/dataflow/nodes/compute_metrics.py index 4e079a27d6..9d4ad3dd92 100644 --- a/metricflow/dataflow/nodes/compute_metrics.py +++ b/metricflow/dataflow/nodes/compute_metrics.py @@ -5,7 +5,8 @@ from metricflow_semantics.dag.id_prefix import IdPrefix, StaticIdPrefix from metricflow_semantics.dag.mf_dag import DisplayedProperty -from metricflow_semantics.specs.spec_classes import LinkableInstanceSpec, MetricSpec +from metricflow_semantics.specs.instance_spec import LinkableInstanceSpec +from metricflow_semantics.specs.metric_spec import MetricSpec from metricflow_semantics.visitor import VisitorOutputT from typing_extensions import override diff --git a/metricflow/dataflow/nodes/join_conversion_events.py b/metricflow/dataflow/nodes/join_conversion_events.py index 029fa0dd1f..ed42661222 100644 --- a/metricflow/dataflow/nodes/join_conversion_events.py +++ b/metricflow/dataflow/nodes/join_conversion_events.py @@ -6,13 +6,11 @@ from dbt_semantic_interfaces.protocols import MetricTimeWindow from metricflow_semantics.dag.id_prefix import IdPrefix, StaticIdPrefix from metricflow_semantics.dag.mf_dag import DisplayedProperty -from metricflow_semantics.specs.spec_classes import ( - ConstantPropertySpec, - EntitySpec, - InstanceSpec, - MeasureSpec, - TimeDimensionSpec, -) +from metricflow_semantics.specs.constant_property_spec import ConstantPropertySpec +from metricflow_semantics.specs.entity_spec import EntitySpec +from metricflow_semantics.specs.instance_spec import InstanceSpec +from metricflow_semantics.specs.measure_spec import MeasureSpec +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from metricflow_semantics.visitor import VisitorOutputT from metricflow.dataflow.dataflow_plan import DataflowPlanNode, DataflowPlanNodeVisitor diff --git a/metricflow/dataflow/nodes/join_over_time.py b/metricflow/dataflow/nodes/join_over_time.py index 8dd71c24bb..b137175472 100644 --- a/metricflow/dataflow/nodes/join_over_time.py +++ b/metricflow/dataflow/nodes/join_over_time.py @@ -8,7 +8,7 @@ from metricflow_semantics.dag.id_prefix import IdPrefix, StaticIdPrefix from metricflow_semantics.dag.mf_dag import DisplayedProperty from metricflow_semantics.filters.time_constraint import TimeRangeConstraint -from metricflow_semantics.specs.spec_classes import TimeDimensionSpec +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from metricflow_semantics.visitor import VisitorOutputT from metricflow.dataflow.dataflow_plan import DataflowPlanNode, DataflowPlanNodeVisitor diff --git a/metricflow/dataflow/nodes/join_to_base.py b/metricflow/dataflow/nodes/join_to_base.py index eb7cd332d1..2a6b2c458e 100644 --- a/metricflow/dataflow/nodes/join_to_base.py +++ b/metricflow/dataflow/nodes/join_to_base.py @@ -5,7 +5,8 @@ from metricflow_semantics.dag.id_prefix import IdPrefix, StaticIdPrefix from metricflow_semantics.dag.mf_dag import DisplayedProperty -from metricflow_semantics.specs.spec_classes import LinklessEntitySpec, TimeDimensionSpec +from metricflow_semantics.specs.entity_spec import LinklessEntitySpec +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from metricflow_semantics.sql.sql_join_type import SqlJoinType from metricflow_semantics.visitor import VisitorOutputT diff --git a/metricflow/dataflow/nodes/join_to_time_spine.py b/metricflow/dataflow/nodes/join_to_time_spine.py index 86f3104ed4..274bf2a26a 100644 --- a/metricflow/dataflow/nodes/join_to_time_spine.py +++ b/metricflow/dataflow/nodes/join_to_time_spine.py @@ -9,7 +9,7 @@ from metricflow_semantics.dag.id_prefix import IdPrefix, StaticIdPrefix from metricflow_semantics.dag.mf_dag import DisplayedProperty from metricflow_semantics.filters.time_constraint import TimeRangeConstraint -from metricflow_semantics.specs.spec_classes import TimeDimensionSpec +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from metricflow_semantics.sql.sql_join_type import SqlJoinType from metricflow_semantics.visitor import VisitorOutputT diff --git a/metricflow/dataflow/nodes/order_by_limit.py b/metricflow/dataflow/nodes/order_by_limit.py index 45eef8cddf..0bb1c77b99 100644 --- a/metricflow/dataflow/nodes/order_by_limit.py +++ b/metricflow/dataflow/nodes/order_by_limit.py @@ -5,7 +5,7 @@ from metricflow_semantics.dag.id_prefix import IdPrefix, StaticIdPrefix from metricflow_semantics.dag.mf_dag import DisplayedProperty -from metricflow_semantics.specs.spec_classes import OrderBySpec +from metricflow_semantics.specs.order_by_spec import OrderBySpec from metricflow_semantics.visitor import VisitorOutputT from metricflow.dataflow.dataflow_plan import ( diff --git a/metricflow/dataflow/nodes/semi_additive_join.py b/metricflow/dataflow/nodes/semi_additive_join.py index b48f10602e..3eaff4d88c 100644 --- a/metricflow/dataflow/nodes/semi_additive_join.py +++ b/metricflow/dataflow/nodes/semi_additive_join.py @@ -6,7 +6,8 @@ from dbt_semantic_interfaces.type_enums import AggregationType from metricflow_semantics.dag.id_prefix import IdPrefix, StaticIdPrefix from metricflow_semantics.dag.mf_dag import DisplayedProperty -from metricflow_semantics.specs.spec_classes import LinklessEntitySpec, TimeDimensionSpec +from metricflow_semantics.specs.entity_spec import LinklessEntitySpec +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from metricflow_semantics.visitor import VisitorOutputT from metricflow.dataflow.dataflow_plan import DataflowPlanNode, DataflowPlanNodeVisitor diff --git a/metricflow/dataflow/nodes/where_filter.py b/metricflow/dataflow/nodes/where_filter.py index fd3f1a527a..7b0bef6cda 100644 --- a/metricflow/dataflow/nodes/where_filter.py +++ b/metricflow/dataflow/nodes/where_filter.py @@ -5,7 +5,7 @@ from metricflow_semantics.dag.id_prefix import IdPrefix, StaticIdPrefix from metricflow_semantics.dag.mf_dag import DisplayedProperty -from metricflow_semantics.specs.spec_classes import WhereFilterSpec +from metricflow_semantics.specs.where_filter.where_filter_spec import WhereFilterSpec from metricflow_semantics.visitor import VisitorOutputT from metricflow.dataflow.dataflow_plan import DataflowPlanNode, DataflowPlanNodeVisitor diff --git a/metricflow/dataflow/nodes/window_reaggregation_node.py b/metricflow/dataflow/nodes/window_reaggregation_node.py index 325bd666b8..93dbf950ba 100644 --- a/metricflow/dataflow/nodes/window_reaggregation_node.py +++ b/metricflow/dataflow/nodes/window_reaggregation_node.py @@ -5,7 +5,9 @@ from metricflow_semantics.dag.id_prefix import IdPrefix, StaticIdPrefix from metricflow_semantics.dag.mf_dag import DisplayedProperty -from metricflow_semantics.specs.spec_classes import InstanceSpec, LinkableInstanceSpec, MetricSpec, TimeDimensionSpec +from metricflow_semantics.specs.instance_spec import InstanceSpec, LinkableInstanceSpec +from metricflow_semantics.specs.metric_spec import MetricSpec +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from metricflow_semantics.visitor import VisitorOutputT from metricflow.dataflow.dataflow_plan import ( diff --git a/metricflow/dataflow/optimizer/predicate_pushdown_optimizer.py b/metricflow/dataflow/optimizer/predicate_pushdown_optimizer.py index 41ad2c2acb..93ae2e1958 100644 --- a/metricflow/dataflow/optimizer/predicate_pushdown_optimizer.py +++ b/metricflow/dataflow/optimizer/predicate_pushdown_optimizer.py @@ -7,7 +7,7 @@ from dbt_semantic_interfaces.references import SemanticModelReference from metricflow_semantics.dag.id_prefix import StaticIdPrefix from metricflow_semantics.dag.mf_dag import DagId -from metricflow_semantics.specs.spec_classes import WhereFilterSpec +from metricflow_semantics.specs.where_filter.where_filter_spec import WhereFilterSpec from metricflow_semantics.sql.sql_join_type import SqlJoinType from metricflow.dataflow.builder.node_data_set import DataflowPlanNodeOutputDataSetResolver diff --git a/metricflow/dataflow/optimizer/source_scan/cm_branch_combiner.py b/metricflow/dataflow/optimizer/source_scan/cm_branch_combiner.py index 732b41452c..6a3856de11 100644 --- a/metricflow/dataflow/optimizer/source_scan/cm_branch_combiner.py +++ b/metricflow/dataflow/optimizer/source_scan/cm_branch_combiner.py @@ -4,7 +4,7 @@ from dataclasses import dataclass from typing import List, Optional, Sequence -from metricflow_semantics.specs.spec_classes import MetricSpec +from metricflow_semantics.specs.metric_spec import MetricSpec from metricflow.dataflow.dataflow_plan import ( DataflowPlanNode, diff --git a/metricflow/dataset/convert_semantic_model.py b/metricflow/dataset/convert_semantic_model.py index 2c76394129..155d0b0eba 100644 --- a/metricflow/dataset/convert_semantic_model.py +++ b/metricflow/dataset/convert_semantic_model.py @@ -10,6 +10,7 @@ from dbt_semantic_interfaces.protocols.measure import Measure from dbt_semantic_interfaces.protocols.semantic_model import SemanticModel from dbt_semantic_interfaces.references import ( + EntityReference, SemanticModelElementReference, SemanticModelReference, ) @@ -28,13 +29,9 @@ from metricflow_semantics.model.semantics.semantic_model_lookup import SemanticModelLookup from metricflow_semantics.model.spec_converters import MeasureConverter from metricflow_semantics.specs.column_assoc import ColumnAssociationResolver -from metricflow_semantics.specs.spec_classes import ( - DEFAULT_TIME_GRANULARITY, - DimensionSpec, - EntityReference, - EntitySpec, - TimeDimensionSpec, -) +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.entity_spec import EntitySpec +from metricflow_semantics.specs.time_dimension_spec import DEFAULT_TIME_GRANULARITY, TimeDimensionSpec from metricflow.dataset.semantic_model_adapter import SemanticModelDataSet from metricflow.dataset.sql_dataset import SqlDataSet diff --git a/metricflow/dataset/dataset_classes.py b/metricflow/dataset/dataset_classes.py index 2a7ab1bbfe..c2a822e42d 100644 --- a/metricflow/dataset/dataset_classes.py +++ b/metricflow/dataset/dataset_classes.py @@ -9,7 +9,7 @@ from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity from dbt_semantic_interfaces.validations.unique_valid_name import MetricFlowReservedKeywords from metricflow_semantics.instances import InstanceSet, TimeDimensionInstance -from metricflow_semantics.specs.spec_classes import TimeDimensionSpec +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec logger = logging.getLogger(__name__) diff --git a/metricflow/dataset/sql_dataset.py b/metricflow/dataset/sql_dataset.py index 38e3a8c241..b38da60910 100644 --- a/metricflow/dataset/sql_dataset.py +++ b/metricflow/dataset/sql_dataset.py @@ -6,7 +6,9 @@ from metricflow_semantics.assert_one_arg import assert_exactly_one_arg_set from metricflow_semantics.instances import EntityInstance, InstanceSet from metricflow_semantics.specs.column_assoc import ColumnAssociation -from metricflow_semantics.specs.spec_classes import DimensionSpec, EntitySpec, TimeDimensionSpec +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.entity_spec import EntitySpec +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from typing_extensions import override from metricflow.dataset.dataset_classes import DataSet diff --git a/metricflow/engine/models.py b/metricflow/engine/models.py index 40aa85c45b..de899b3018 100644 --- a/metricflow/engine/models.py +++ b/metricflow/engine/models.py @@ -24,11 +24,12 @@ SavedQueryQueryParams, ) from dbt_semantic_interfaces.protocols.where_filter import WhereFilterIntersection +from dbt_semantic_interfaces.references import EntityReference from dbt_semantic_interfaces.transformations.add_input_metric_measures import AddInputMetricMeasuresRule from dbt_semantic_interfaces.type_enums.aggregation_type import AggregationType from dbt_semantic_interfaces.type_enums.entity_type import EntityType from metricflow_semantics.naming.linkable_spec_name import StructuredLinkableSpecName -from metricflow_semantics.specs.spec_classes import DimensionSpec, EntityReference +from metricflow_semantics.specs.dimension_spec import DimensionSpec @dataclass(frozen=True) diff --git a/metricflow/plan_conversion/dataflow_to_sql.py b/metricflow/plan_conversion/dataflow_to_sql.py index ad2d989989..d41b24cab2 100644 --- a/metricflow/plan_conversion/dataflow_to_sql.py +++ b/metricflow/plan_conversion/dataflow_to_sql.py @@ -31,15 +31,13 @@ ColumnAssociation, ColumnAssociationResolver, ) -from metricflow_semantics.specs.spec_classes import ( - GroupByMetricSpec, - InstanceSpec, - MeasureSpec, - MetadataSpec, - MetricSpec, - TimeDimensionSpec, -) +from metricflow_semantics.specs.group_by_metric_spec import GroupByMetricSpec +from metricflow_semantics.specs.instance_spec import InstanceSpec +from metricflow_semantics.specs.measure_spec import MeasureSpec +from metricflow_semantics.specs.metadata_spec import MetadataSpec +from metricflow_semantics.specs.metric_spec import MetricSpec from metricflow_semantics.specs.spec_set import InstanceSpecSet +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from metricflow_semantics.sql.sql_join_type import SqlJoinType from metricflow_semantics.time.time_constants import ISO8601_PYTHON_FORMAT diff --git a/metricflow/plan_conversion/instance_converters.py b/metricflow/plan_conversion/instance_converters.py index c33fc5bbb3..3f8af77259 100644 --- a/metricflow/plan_conversion/instance_converters.py +++ b/metricflow/plan_conversion/instance_converters.py @@ -8,7 +8,7 @@ from itertools import chain from typing import Dict, List, Optional, Sequence, Tuple -from dbt_semantic_interfaces.references import MetricReference, SemanticModelReference +from dbt_semantic_interfaces.references import EntityReference, MetricReference, SemanticModelReference from dbt_semantic_interfaces.type_enums.aggregation_type import AggregationType from dbt_semantic_interfaces.type_enums.date_part import DatePart from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity @@ -29,19 +29,13 @@ from metricflow_semantics.model.semantics.metric_lookup import MetricLookup from metricflow_semantics.model.semantics.semantic_model_lookup import SemanticModelLookup from metricflow_semantics.specs.column_assoc import ColumnAssociationResolver -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - EntityReference, - EntitySpec, - GroupByMetricSpec, - InstanceSpec, - LinkableInstanceSpec, - LinklessEntitySpec, - MeasureSpec, - MetricInputMeasureSpec, - TimeDimensionSpec, -) +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.entity_spec import EntitySpec, LinklessEntitySpec +from metricflow_semantics.specs.group_by_metric_spec import GroupByMetricSpec +from metricflow_semantics.specs.instance_spec import InstanceSpec, LinkableInstanceSpec +from metricflow_semantics.specs.measure_spec import MeasureSpec, MetricInputMeasureSpec from metricflow_semantics.specs.spec_set import InstanceSpecSet +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from more_itertools import bucket from metricflow.dataflow.nodes.join_to_base import ValidityWindowJoinDescription diff --git a/metricflow/plan_conversion/node_processor.py b/metricflow/plan_conversion/node_processor.py index 57f4f1d8ea..0334ae81fb 100644 --- a/metricflow/plan_conversion/node_processor.py +++ b/metricflow/plan_conversion/node_processor.py @@ -12,9 +12,11 @@ from metricflow_semantics.model.semantics.linkable_element import LinkableElementType from metricflow_semantics.model.semantics.semantic_model_join_evaluator import MAX_JOIN_HOPS from metricflow_semantics.model.semantics.semantic_model_lookup import SemanticModelLookup -from metricflow_semantics.specs.spec_classes import LinkableInstanceSpec, LinklessEntitySpec, WhereFilterSpec +from metricflow_semantics.specs.entity_spec import LinklessEntitySpec +from metricflow_semantics.specs.instance_spec import LinkableInstanceSpec from metricflow_semantics.specs.spec_set import group_specs_by_type from metricflow_semantics.specs.spec_set_transforms import ToElementNameSet +from metricflow_semantics.specs.where_filter.where_filter_spec import WhereFilterSpec from metricflow_semantics.sql.sql_join_type import SqlJoinType from metricflow.dataflow.builder.node_data_set import DataflowPlanNodeOutputDataSetResolver diff --git a/metricflow/plan_conversion/time_spine.py b/metricflow/plan_conversion/time_spine.py index 0132c99cb4..858c0bdb0e 100644 --- a/metricflow/plan_conversion/time_spine.py +++ b/metricflow/plan_conversion/time_spine.py @@ -7,7 +7,7 @@ from dbt_semantic_interfaces.protocols import SemanticManifest from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity from metricflow_semantics.mf_logging.pretty_print import mf_pformat -from metricflow_semantics.specs.spec_classes import DEFAULT_TIME_GRANULARITY +from metricflow_semantics.specs.time_dimension_spec import DEFAULT_TIME_GRANULARITY from metricflow.sql.sql_table import SqlTable diff --git a/metricflow/validation/data_warehouse_model_validator.py b/metricflow/validation/data_warehouse_model_validator.py index a9d076278f..7d05afb87b 100644 --- a/metricflow/validation/data_warehouse_model_validator.py +++ b/metricflow/validation/data_warehouse_model_validator.py @@ -31,7 +31,8 @@ ) from metricflow_semantics.model.semantic_manifest_lookup import SemanticManifestLookup from metricflow_semantics.specs.dunder_column_association_resolver import DunderColumnAssociationResolver -from metricflow_semantics.specs.spec_classes import LinkableInstanceSpec, MeasureSpec +from metricflow_semantics.specs.instance_spec import LinkableInstanceSpec +from metricflow_semantics.specs.measure_spec import MeasureSpec from metricflow_semantics.specs.spec_set import InstanceSpecSet from metricflow_semantics.sql.sql_bind_parameters import SqlBindParameters diff --git a/scripts/ci_tests/metricflow_package_test.py b/scripts/ci_tests/metricflow_package_test.py index ab8bfb0f49..9b0d4fffd0 100644 --- a/scripts/ci_tests/metricflow_package_test.py +++ b/scripts/ci_tests/metricflow_package_test.py @@ -9,16 +9,14 @@ from dbt_semantic_interfaces.parsing.dir_to_model import parse_yaml_files_to_validation_ready_semantic_manifest from dbt_semantic_interfaces.parsing.objects import YamlConfigFile from dbt_semantic_interfaces.protocols import SemanticManifest, SemanticModel +from dbt_semantic_interfaces.references import EntityReference from dbt_semantic_interfaces.validations.semantic_manifest_validator import SemanticManifestValidator from metricflow_semantics.model.semantic_manifest_lookup import SemanticManifestLookup from metricflow_semantics.specs.column_assoc import ColumnAssociationResolver +from metricflow_semantics.specs.dimension_spec import DimensionSpec from metricflow_semantics.specs.dunder_column_association_resolver import DunderColumnAssociationResolver +from metricflow_semantics.specs.metric_spec import MetricSpec from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - EntityReference, - MetricSpec, -) from metricflow.dataflow.builder.dataflow_plan_builder import DataflowPlanBuilder from metricflow.dataflow.builder.node_data_set import DataflowPlanNodeOutputDataSetResolver diff --git a/tests_metricflow/dataflow/builder/test_cyclic_join.py b/tests_metricflow/dataflow/builder/test_cyclic_join.py index 07c2a13c16..6f6209fabd 100644 --- a/tests_metricflow/dataflow/builder/test_cyclic_join.py +++ b/tests_metricflow/dataflow/builder/test_cyclic_join.py @@ -6,11 +6,9 @@ import pytest from _pytest.fixtures import FixtureRequest from dbt_semantic_interfaces.references import EntityReference +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.metric_spec import MetricSpec from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - MetricSpec, -) from metricflow_semantics.test_helpers.config_helpers import MetricFlowTestConfiguration from metricflow_semantics.test_helpers.snapshot_helpers import assert_plan_snapshot_text_equal diff --git a/tests_metricflow/dataflow/builder/test_dataflow_plan_builder.py b/tests_metricflow/dataflow/builder/test_dataflow_plan_builder.py index 3dfed14897..601f6fc436 100644 --- a/tests_metricflow/dataflow/builder/test_dataflow_plan_builder.py +++ b/tests_metricflow/dataflow/builder/test_dataflow_plan_builder.py @@ -8,22 +8,19 @@ from _pytest.fixtures import FixtureRequest from dbt_semantic_interfaces.implementations.filters.where_filter import PydanticWhereFilter from dbt_semantic_interfaces.naming.keywords import METRIC_TIME_ELEMENT_NAME -from dbt_semantic_interfaces.references import MeasureReference +from dbt_semantic_interfaces.references import EntityReference, MeasureReference from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity from metricflow_semantics.errors.error_classes import UnableToSatisfyQueryError from metricflow_semantics.filters.time_constraint import TimeRangeConstraint from metricflow_semantics.model.semantics.linkable_element_set import LinkableElementSet from metricflow_semantics.query.query_parser import MetricFlowQueryParser from metricflow_semantics.specs.column_assoc import ColumnAssociationResolver +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.group_by_metric_spec import GroupByMetricSpec +from metricflow_semantics.specs.metric_spec import MetricSpec +from metricflow_semantics.specs.order_by_spec import OrderBySpec from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - EntityReference, - GroupByMetricSpec, - MetricSpec, - OrderBySpec, - TimeDimensionSpec, -) +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from metricflow_semantics.test_helpers.config_helpers import MetricFlowTestConfiguration from metricflow_semantics.test_helpers.metric_time_dimension import ( MTD_SPEC_DAY, diff --git a/tests_metricflow/dataflow/builder/test_measure_additiveness.py b/tests_metricflow/dataflow/builder/test_measure_additiveness.py index 64893e16a3..a4b67d4787 100644 --- a/tests_metricflow/dataflow/builder/test_measure_additiveness.py +++ b/tests_metricflow/dataflow/builder/test_measure_additiveness.py @@ -1,7 +1,8 @@ from __future__ import annotations from dbt_semantic_interfaces.type_enums.aggregation_type import AggregationType -from metricflow_semantics.specs.spec_classes import MeasureSpec, NonAdditiveDimensionSpec +from metricflow_semantics.specs.measure_spec import MeasureSpec +from metricflow_semantics.specs.non_additive_dimension_spec import NonAdditiveDimensionSpec from metricflow.dataflow.builder.measure_additiveness import group_measure_specs_by_additiveness diff --git a/tests_metricflow/dataflow/builder/test_node_data_set.py b/tests_metricflow/dataflow/builder/test_node_data_set.py index 8c05459111..ab3083b84c 100644 --- a/tests_metricflow/dataflow/builder/test_node_data_set.py +++ b/tests_metricflow/dataflow/builder/test_node_data_set.py @@ -13,10 +13,8 @@ from metricflow_semantics.model.semantic_manifest_lookup import SemanticManifestLookup from metricflow_semantics.specs.column_assoc import ColumnAssociation from metricflow_semantics.specs.dunder_column_association_resolver import DunderColumnAssociationResolver -from metricflow_semantics.specs.spec_classes import ( - LinklessEntitySpec, - MeasureSpec, -) +from metricflow_semantics.specs.entity_spec import LinklessEntitySpec +from metricflow_semantics.specs.measure_spec import MeasureSpec from metricflow_semantics.sql.sql_join_type import SqlJoinType from metricflow_semantics.test_helpers.config_helpers import MetricFlowTestConfiguration from metricflow_semantics.test_helpers.snapshot_helpers import assert_spec_set_snapshot_equal diff --git a/tests_metricflow/dataflow/builder/test_node_evaluator.py b/tests_metricflow/dataflow/builder/test_node_evaluator.py index 07245d1257..92fa8cc172 100644 --- a/tests_metricflow/dataflow/builder/test_node_evaluator.py +++ b/tests_metricflow/dataflow/builder/test_node_evaluator.py @@ -4,17 +4,14 @@ from typing import Mapping, Sequence import pytest +from dbt_semantic_interfaces.references import EntityReference from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity from metricflow_semantics.model.semantic_manifest_lookup import SemanticManifestLookup +from metricflow_semantics.specs.dimension_spec import DimensionSpec from metricflow_semantics.specs.dunder_column_association_resolver import DunderColumnAssociationResolver -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - EntityReference, - EntitySpec, - LinkableInstanceSpec, - LinklessEntitySpec, - TimeDimensionSpec, -) +from metricflow_semantics.specs.entity_spec import EntitySpec, LinklessEntitySpec +from metricflow_semantics.specs.instance_spec import LinkableInstanceSpec +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from metricflow_semantics.sql.sql_join_type import SqlJoinType from metricflow.dataflow.builder.node_data_set import DataflowPlanNodeOutputDataSetResolver diff --git a/tests_metricflow/dataflow/optimizer/source_scan/test_cm_branch_combiner.py b/tests_metricflow/dataflow/optimizer/source_scan/test_cm_branch_combiner.py index 096dd30fa9..8a3906060c 100644 --- a/tests_metricflow/dataflow/optimizer/source_scan/test_cm_branch_combiner.py +++ b/tests_metricflow/dataflow/optimizer/source_scan/test_cm_branch_combiner.py @@ -6,7 +6,7 @@ from _pytest.fixtures import FixtureRequest from metricflow_semantics.dag.id_prefix import StaticIdPrefix from metricflow_semantics.dag.mf_dag import DagId -from metricflow_semantics.specs.spec_classes import MeasureSpec +from metricflow_semantics.specs.measure_spec import MeasureSpec from metricflow_semantics.specs.spec_set import InstanceSpecSet from metricflow_semantics.test_helpers.config_helpers import MetricFlowTestConfiguration from metricflow_semantics.test_helpers.snapshot_helpers import assert_plan_snapshot_text_equal diff --git a/tests_metricflow/dataflow/optimizer/source_scan/test_source_scan_optimizer.py b/tests_metricflow/dataflow/optimizer/source_scan/test_source_scan_optimizer.py index f6e10745dd..c8cbb851c6 100644 --- a/tests_metricflow/dataflow/optimizer/source_scan/test_source_scan_optimizer.py +++ b/tests_metricflow/dataflow/optimizer/source_scan/test_source_scan_optimizer.py @@ -5,15 +5,13 @@ import pytest from _pytest.fixtures import FixtureRequest from dbt_semantic_interfaces.naming.keywords import METRIC_TIME_ELEMENT_NAME +from dbt_semantic_interfaces.references import EntityReference from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity from metricflow_semantics.query.query_parser import MetricFlowQueryParser from metricflow_semantics.specs.column_assoc import ColumnAssociationResolver +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.metric_spec import MetricSpec from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - EntityReference, - MetricSpec, -) from metricflow_semantics.test_helpers.config_helpers import MetricFlowTestConfiguration from metricflow_semantics.test_helpers.snapshot_helpers import assert_plan_snapshot_text_equal diff --git a/tests_metricflow/dataflow/optimizer/test_predicate_pushdown_optimizer.py b/tests_metricflow/dataflow/optimizer/test_predicate_pushdown_optimizer.py index 750fbbdc99..8379a47a95 100644 --- a/tests_metricflow/dataflow/optimizer/test_predicate_pushdown_optimizer.py +++ b/tests_metricflow/dataflow/optimizer/test_predicate_pushdown_optimizer.py @@ -8,9 +8,7 @@ from metricflow_semantics.filters.time_constraint import TimeRangeConstraint from metricflow_semantics.query.query_parser import MetricFlowQueryParser from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec -from metricflow_semantics.specs.spec_classes import ( - WhereFilterSpec, -) +from metricflow_semantics.specs.where_filter.where_filter_spec import WhereFilterSpec from metricflow_semantics.sql.sql_bind_parameters import SqlBindParameters from metricflow_semantics.test_helpers.config_helpers import MetricFlowTestConfiguration from metricflow_semantics.test_helpers.snapshot_helpers import assert_plan_snapshot_text_equal diff --git a/tests_metricflow/dataflow/test_dataflow_plan.py b/tests_metricflow/dataflow/test_dataflow_plan.py index 1fba5b5662..8a2c925b6c 100644 --- a/tests_metricflow/dataflow/test_dataflow_plan.py +++ b/tests_metricflow/dataflow/test_dataflow_plan.py @@ -3,11 +3,9 @@ from __future__ import annotations from dbt_semantic_interfaces.references import EntityReference, SemanticModelReference +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.metric_spec import MetricSpec from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - MetricSpec, -) from metricflow.dataflow.builder.dataflow_plan_builder import DataflowPlanBuilder diff --git a/tests_metricflow/examples/test_node_sql.py b/tests_metricflow/examples/test_node_sql.py index aa88d93868..4d4f5923bd 100644 --- a/tests_metricflow/examples/test_node_sql.py +++ b/tests_metricflow/examples/test_node_sql.py @@ -3,13 +3,13 @@ import logging import pytest -from dbt_semantic_interfaces.references import SemanticModelReference +from dbt_semantic_interfaces.references import SemanticModelReference, TimeDimensionReference from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity from metricflow_semantics.mf_logging.pretty_print import mf_pformat from metricflow_semantics.model.semantic_manifest_lookup import SemanticManifestLookup from metricflow_semantics.specs.dunder_column_association_resolver import DunderColumnAssociationResolver -from metricflow_semantics.specs.spec_classes import TimeDimensionReference, TimeDimensionSpec from metricflow_semantics.specs.spec_set import InstanceSpecSet +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from metricflow.dataflow.builder.node_data_set import DataflowPlanNodeOutputDataSetResolver from metricflow.dataflow.nodes.filter_elements import FilterElementsNode diff --git a/tests_metricflow/plan_conversion/dataflow_to_sql/test_conversion_metrics_to_sql.py b/tests_metricflow/plan_conversion/dataflow_to_sql/test_conversion_metrics_to_sql.py index 074d13951e..f58ac4c5ee 100644 --- a/tests_metricflow/plan_conversion/dataflow_to_sql/test_conversion_metrics_to_sql.py +++ b/tests_metricflow/plan_conversion/dataflow_to_sql/test_conversion_metrics_to_sql.py @@ -4,12 +4,10 @@ from _pytest.fixtures import FixtureRequest from dbt_semantic_interfaces.references import EntityReference from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.metric_spec import MetricSpec from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - MetricSpec, - TimeDimensionSpec, -) +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from metricflow_semantics.test_helpers.config_helpers import MetricFlowTestConfiguration from metricflow.dataflow.builder.dataflow_plan_builder import DataflowPlanBuilder diff --git a/tests_metricflow/plan_conversion/dataflow_to_sql/test_distinct_values_to_sql.py b/tests_metricflow/plan_conversion/dataflow_to_sql/test_distinct_values_to_sql.py index 2898dedfa9..a7cfcd708b 100644 --- a/tests_metricflow/plan_conversion/dataflow_to_sql/test_distinct_values_to_sql.py +++ b/tests_metricflow/plan_conversion/dataflow_to_sql/test_distinct_values_to_sql.py @@ -6,8 +6,8 @@ from dbt_semantic_interfaces.references import EntityReference from metricflow_semantics.query.query_parser import MetricFlowQueryParser from metricflow_semantics.specs.column_assoc import ColumnAssociationResolver +from metricflow_semantics.specs.dimension_spec import DimensionSpec from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec -from metricflow_semantics.specs.spec_classes import DimensionSpec from metricflow_semantics.test_helpers.config_helpers import MetricFlowTestConfiguration from metricflow.dataflow.builder.dataflow_plan_builder import DataflowPlanBuilder diff --git a/tests_metricflow/plan_conversion/dataflow_to_sql/test_metric_time_dimension_to_sql.py b/tests_metricflow/plan_conversion/dataflow_to_sql/test_metric_time_dimension_to_sql.py index 3a4b460772..ad3ffb6e0b 100644 --- a/tests_metricflow/plan_conversion/dataflow_to_sql/test_metric_time_dimension_to_sql.py +++ b/tests_metricflow/plan_conversion/dataflow_to_sql/test_metric_time_dimension_to_sql.py @@ -5,8 +5,8 @@ import pytest from _pytest.fixtures import FixtureRequest from dbt_semantic_interfaces.references import TimeDimensionReference +from metricflow_semantics.specs.metric_spec import MetricSpec from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec -from metricflow_semantics.specs.spec_classes import MetricSpec from metricflow_semantics.test_helpers.config_helpers import MetricFlowTestConfiguration from metricflow_semantics.test_helpers.metric_time_dimension import MTD_SPEC_DAY diff --git a/tests_metricflow/plan_conversion/instance_converters/test_create_select_columns_with_measures_aggregated.py b/tests_metricflow/plan_conversion/instance_converters/test_create_select_columns_with_measures_aggregated.py index c07ade0bb6..68ca855c4e 100644 --- a/tests_metricflow/plan_conversion/instance_converters/test_create_select_columns_with_measures_aggregated.py +++ b/tests_metricflow/plan_conversion/instance_converters/test_create_select_columns_with_measures_aggregated.py @@ -5,7 +5,7 @@ from metricflow_semantics.instances import InstanceSet from metricflow_semantics.model.semantic_manifest_lookup import SemanticManifestLookup from metricflow_semantics.specs.dunder_column_association_resolver import DunderColumnAssociationResolver -from metricflow_semantics.specs.spec_classes import MeasureSpec, MetricInputMeasureSpec +from metricflow_semantics.specs.measure_spec import MeasureSpec, MetricInputMeasureSpec from metricflow_semantics.specs.spec_set import InstanceSpecSet from metricflow.plan_conversion.instance_converters import ( diff --git a/tests_metricflow/plan_conversion/instance_converters/test_create_validity_window_join_description.py b/tests_metricflow/plan_conversion/instance_converters/test_create_validity_window_join_description.py index 3e3738f77a..72cb6ee654 100644 --- a/tests_metricflow/plan_conversion/instance_converters/test_create_validity_window_join_description.py +++ b/tests_metricflow/plan_conversion/instance_converters/test_create_validity_window_join_description.py @@ -6,7 +6,7 @@ from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity from metricflow_semantics.instances import InstanceSet from metricflow_semantics.model.semantic_manifest_lookup import SemanticManifestLookup -from metricflow_semantics.specs.spec_classes import TimeDimensionSpec +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from metricflow.dataflow.nodes.join_to_base import ValidityWindowJoinDescription from metricflow.plan_conversion.instance_converters import CreateValidityWindowJoinDescription diff --git a/tests_metricflow/plan_conversion/test_dataflow_to_execution.py b/tests_metricflow/plan_conversion/test_dataflow_to_execution.py index 5197fe1d63..b92a26a2ec 100644 --- a/tests_metricflow/plan_conversion/test_dataflow_to_execution.py +++ b/tests_metricflow/plan_conversion/test_dataflow_to_execution.py @@ -2,15 +2,13 @@ import pytest from _pytest.fixtures import FixtureRequest +from dbt_semantic_interfaces.references import EntityReference from metricflow_semantics.model.semantic_manifest_lookup import SemanticManifestLookup +from metricflow_semantics.specs.dimension_spec import DimensionSpec from metricflow_semantics.specs.dunder_column_association_resolver import DunderColumnAssociationResolver +from metricflow_semantics.specs.metric_spec import MetricSpec from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - EntityReference, - MetricSpec, - TimeDimensionSpec, -) +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from metricflow_semantics.test_helpers.config_helpers import MetricFlowTestConfiguration from metricflow.dataflow.builder.dataflow_plan_builder import DataflowPlanBuilder diff --git a/tests_metricflow/plan_conversion/test_dataflow_to_sql_plan.py b/tests_metricflow/plan_conversion/test_dataflow_to_sql_plan.py index 88fd000fda..0448d27011 100644 --- a/tests_metricflow/plan_conversion/test_dataflow_to_sql_plan.py +++ b/tests_metricflow/plan_conversion/test_dataflow_to_sql_plan.py @@ -15,19 +15,16 @@ from metricflow_semantics.model.semantics.linkable_element import LinkableDimension, SemanticModelJoinPath from metricflow_semantics.query.query_parser import MetricFlowQueryParser from metricflow_semantics.specs.column_assoc import ColumnAssociationResolver +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.entity_spec import LinklessEntitySpec +from metricflow_semantics.specs.measure_spec import MeasureSpec, MetricInputMeasureSpec +from metricflow_semantics.specs.metric_spec import MetricSpec +from metricflow_semantics.specs.non_additive_dimension_spec import NonAdditiveDimensionSpec +from metricflow_semantics.specs.order_by_spec import OrderBySpec from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - LinklessEntitySpec, - MeasureSpec, - MetricInputMeasureSpec, - MetricSpec, - NonAdditiveDimensionSpec, - OrderBySpec, - TimeDimensionSpec, - WhereFilterSpec, -) from metricflow_semantics.specs.spec_set import InstanceSpecSet +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec +from metricflow_semantics.specs.where_filter.where_filter_spec import WhereFilterSpec from metricflow_semantics.sql.sql_bind_parameters import SqlBindParameters from metricflow_semantics.sql.sql_join_type import SqlJoinType from metricflow_semantics.test_helpers.config_helpers import MetricFlowTestConfiguration diff --git a/tests_metricflow/query_rendering/test_cumulative_metric_rendering.py b/tests_metricflow/query_rendering/test_cumulative_metric_rendering.py index 5575b91146..f2bd527cc7 100644 --- a/tests_metricflow/query_rendering/test_cumulative_metric_rendering.py +++ b/tests_metricflow/query_rendering/test_cumulative_metric_rendering.py @@ -8,13 +8,15 @@ from _pytest.fixtures import FixtureRequest from dbt_semantic_interfaces.implementations.filters.where_filter import PydanticWhereFilter from dbt_semantic_interfaces.naming.keywords import METRIC_TIME_ELEMENT_NAME +from dbt_semantic_interfaces.references import EntityReference from dbt_semantic_interfaces.test_utils import as_datetime from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity from metricflow_semantics.filters.time_constraint import TimeRangeConstraint from metricflow_semantics.query.query_parser import MetricFlowQueryParser from metricflow_semantics.specs.column_assoc import ColumnAssociationResolver +from metricflow_semantics.specs.metric_spec import MetricSpec from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec -from metricflow_semantics.specs.spec_classes import EntityReference, MetricSpec, TimeDimensionSpec +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from metricflow_semantics.test_helpers.config_helpers import MetricFlowTestConfiguration from metricflow_semantics.test_helpers.metric_time_dimension import ( MTD_SPEC_DAY, diff --git a/tests_metricflow/query_rendering/test_derived_metric_rendering.py b/tests_metricflow/query_rendering/test_derived_metric_rendering.py index 3c57138f1e..83e976676d 100644 --- a/tests_metricflow/query_rendering/test_derived_metric_rendering.py +++ b/tests_metricflow/query_rendering/test_derived_metric_rendering.py @@ -12,10 +12,8 @@ from metricflow_semantics.naming.dunder_scheme import DunderNamingScheme from metricflow_semantics.query.query_parser import MetricFlowQueryParser from metricflow_semantics.specs.column_assoc import ColumnAssociationResolver +from metricflow_semantics.specs.metric_spec import MetricSpec from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec -from metricflow_semantics.specs.spec_classes import ( - MetricSpec, -) from metricflow_semantics.test_helpers.config_helpers import MetricFlowTestConfiguration from metricflow_semantics.test_helpers.metric_time_dimension import ( MTD_SPEC_DAY, diff --git a/tests_metricflow/query_rendering/test_fill_nulls_with_rendering.py b/tests_metricflow/query_rendering/test_fill_nulls_with_rendering.py index ee8b868453..ffe678117c 100644 --- a/tests_metricflow/query_rendering/test_fill_nulls_with_rendering.py +++ b/tests_metricflow/query_rendering/test_fill_nulls_with_rendering.py @@ -12,12 +12,10 @@ from dbt_semantic_interfaces.references import EntityReference from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity from metricflow_semantics.query.query_parser import MetricFlowQueryParser +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.metric_spec import MetricSpec from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - MetricSpec, - TimeDimensionSpec, -) +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from metricflow_semantics.test_helpers.config_helpers import MetricFlowTestConfiguration from metricflow.dataflow.builder.dataflow_plan_builder import DataflowPlanBuilder diff --git a/tests_metricflow/query_rendering/test_granularity_date_part_rendering.py b/tests_metricflow/query_rendering/test_granularity_date_part_rendering.py index eeebee90d2..ef9ba71f0b 100644 --- a/tests_metricflow/query_rendering/test_granularity_date_part_rendering.py +++ b/tests_metricflow/query_rendering/test_granularity_date_part_rendering.py @@ -10,10 +10,8 @@ from _pytest.fixtures import FixtureRequest from dbt_semantic_interfaces.type_enums.date_part import DatePart from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity +from metricflow_semantics.specs.metric_spec import MetricSpec from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec -from metricflow_semantics.specs.spec_classes import ( - MetricSpec, -) from metricflow_semantics.test_helpers.config_helpers import MetricFlowTestConfiguration from metricflow.dataflow.builder.dataflow_plan_builder import DataflowPlanBuilder diff --git a/tests_metricflow/query_rendering/test_metric_time_without_metrics.py b/tests_metricflow/query_rendering/test_metric_time_without_metrics.py index e83fade1b8..0978388681 100644 --- a/tests_metricflow/query_rendering/test_metric_time_without_metrics.py +++ b/tests_metricflow/query_rendering/test_metric_time_without_metrics.py @@ -7,8 +7,9 @@ from dbt_semantic_interfaces.references import EntityReference from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity from metricflow_semantics.filters.time_constraint import TimeRangeConstraint +from metricflow_semantics.specs.dimension_spec import DimensionSpec from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec -from metricflow_semantics.specs.spec_classes import DimensionSpec, TimeDimensionSpec +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from metricflow_semantics.test_helpers.config_helpers import MetricFlowTestConfiguration from metricflow_semantics.test_helpers.metric_time_dimension import MTD_SPEC_DAY diff --git a/tests_metricflow/query_rendering/test_query_rendering.py b/tests_metricflow/query_rendering/test_query_rendering.py index fe50f67f7c..26a02adce5 100644 --- a/tests_metricflow/query_rendering/test_query_rendering.py +++ b/tests_metricflow/query_rendering/test_query_rendering.py @@ -18,12 +18,10 @@ from metricflow_semantics.filters.time_constraint import TimeRangeConstraint from metricflow_semantics.query.query_parser import MetricFlowQueryParser from metricflow_semantics.specs.column_assoc import ColumnAssociationResolver +from metricflow_semantics.specs.dimension_spec import DimensionSpec +from metricflow_semantics.specs.metric_spec import MetricSpec from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec -from metricflow_semantics.specs.spec_classes import ( - DimensionSpec, - MetricSpec, - TimeDimensionSpec, -) +from metricflow_semantics.specs.time_dimension_spec import TimeDimensionSpec from metricflow_semantics.test_helpers.config_helpers import MetricFlowTestConfiguration from metricflow_semantics.test_helpers.metric_time_dimension import MTD_SPEC_DAY, MTD_SPEC_WEEK diff --git a/tests_metricflow/query_rendering/test_time_spine_join_rendering.py b/tests_metricflow/query_rendering/test_time_spine_join_rendering.py index f783677c1d..d477dd70ce 100644 --- a/tests_metricflow/query_rendering/test_time_spine_join_rendering.py +++ b/tests_metricflow/query_rendering/test_time_spine_join_rendering.py @@ -15,8 +15,8 @@ from dbt_semantic_interfaces.implementations.filters.where_filter import PydanticWhereFilter from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity from metricflow_semantics.query.query_parser import MetricFlowQueryParser +from metricflow_semantics.specs.metric_spec import MetricSpec from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec -from metricflow_semantics.specs.spec_classes import MetricSpec from metricflow_semantics.test_helpers.config_helpers import MetricFlowTestConfiguration from metricflow.dataflow.builder.dataflow_plan_builder import DataflowPlanBuilder diff --git a/tests_metricflow/table_snapshot/table_snapshots.py b/tests_metricflow/table_snapshot/table_snapshots.py index b2474cc0d8..a0800eaf4f 100644 --- a/tests_metricflow/table_snapshot/table_snapshots.py +++ b/tests_metricflow/table_snapshot/table_snapshots.py @@ -12,7 +12,7 @@ import yaml from dbt_semantic_interfaces.enum_extension import assert_values_exhausted from dbt_semantic_interfaces.implementations.base import FrozenBaseModel -from metricflow_semantics.specs.spec_classes import hash_items +from metricflow_semantics.specs.non_additive_dimension_spec import hash_items from metricflow.data_table.column_types import CellValue from metricflow.data_table.mf_table import MetricFlowDataTable