Skip to content

Commit

Permalink
Rename YAML -> config
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb committed Nov 8, 2023
1 parent aa32059 commit 6545bc1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions metricflow/model/semantics/metric_lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ def add_metric(self, metric: Metric) -> None:
)
self._metrics[metric_reference] = metric

def yaml_input_measure_for_metric(self, metric_reference: MetricReference) -> Optional[MetricInputMeasure]:
"""Get input measure defined in the metric YAML, if exists.
def configured_input_measure_for_metric(self, metric_reference: MetricReference) -> Optional[MetricInputMeasure]:
"""Get input measure defined in the original metric config, if exists.
When SemanticModel is constructed, input measures from input metrics are added to the list of input measures
for a metric. Here, use rules about metric types to determine which input measures were defined in the YAML:
for a metric. Here, use rules about metric types to determine which input measures were defined in the config:
- Simple & cumulative metrics require one input measure, and can't take any input metrics.
- Derived & ratio metrics take no input measures, only input metrics.
"""
Expand Down
4 changes: 3 additions & 1 deletion metricflow/plan_conversion/dataflow_to_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,9 @@ def _make_select_columns_for_multiple_metrics(
# At this point, the MetricSpec might have the alias in place of the element name, so we need to look
# back at where it was defined from to get the metric element name.
metric_reference = MetricReference(element_name=metric_instance.defined_from.metric_name)
input_measure = self._metric_lookup.yaml_input_measure_for_metric(metric_reference=metric_reference)
input_measure = self._metric_lookup.configured_input_measure_for_metric(
metric_reference=metric_reference
)
if input_measure and input_measure.fill_nulls_with is not None:
select_expression = SqlAggregateFunctionExpression(
sql_function=SqlFunction.COALESCE,
Expand Down

0 comments on commit 6545bc1

Please sign in to comment.