Skip to content

Commit

Permalink
Incorporate default_grain
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb committed Jun 18, 2024
1 parent 72912f4 commit 34149ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from dbt_semantic_interfaces.transformations.convert_median import (
ConvertMedianToPercentileRule,
)
from dbt_semantic_interfaces.transformations.default_grain import SetDefaultGrainRule
from dbt_semantic_interfaces.transformations.names import LowerCaseNamesRule
from dbt_semantic_interfaces.transformations.proxy_measure import CreateProxyMeasureRule
from dbt_semantic_interfaces.transformations.semantic_manifest_transformer import (
Expand All @@ -35,6 +36,7 @@ def parse_manifest_from_dbt_generated_manifest(manifest_json_string: str) -> Pyd
ConvertCountToSumRule(),
ConvertMedianToPercentileRule(),
DedupeMetricInputMeasuresRule(), # Remove once fix is in core
SetDefaultGrainRule(),
),
)
model = PydanticSemanticManifestTransformer.transform(raw_model, rules)
Expand Down
5 changes: 4 additions & 1 deletion metricflow/dataflow/builder/dataflow_plan_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,10 @@ def _build_cumulative_metric_output_node(
predicate_pushdown_state: PredicatePushdownState,
for_group_by_source_node: bool = False,
) -> DataflowPlanNode:
# TODO: replace with default_grain once added to YAML spec
# TODO: use default grain
# What is the expected behavior if you query with default grain?
# What if you query with a grain smaller than default? And larger?
# TODO elsewhere: use default grain for metric_time resolution
default_granularity = self._metric_lookup.get_min_queryable_time_granularity(metric_spec.reference)

queried_agg_time_dimensions = queried_linkable_specs.included_agg_time_dimension_specs_for_metric(
Expand Down

0 comments on commit 34149ae

Please sign in to comment.