Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb committed Apr 18, 2024
1 parent 4f4c45a commit 054e26f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions metricflow/model/semantics/linkable_spec_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,9 +630,12 @@ def _get_joinable_metrics_for_semantic_model(
"""Get the set of linkable metrics that can be joined to this semantic model."""
properties = frozenset({LinkableElementProperty.METRIC, LinkableElementProperty.JOINED})
if using_join_path:
assert (
semantic_model.reference == using_join_path.last_semantic_model_reference
), "Last join path element should match semantic model when building LinkableMetrics."
assert semantic_model.reference == using_join_path.last_semantic_model_reference, (
"Last join path element should match semantic model when building LinkableMetrics. "
f"Got semantic model: {semantic_model.reference.semantic_model_name}; "
f"last join path element: {using_join_path.last_semantic_model_reference.semantic_model_name}",
)
# TODO: confirm that this is what we internally consider multi-hop
properties = properties.union(frozenset({LinkableElementProperty.MULTI_HOP}))

path_key_to_linkable_metrics: Dict[ElementPathKey, Tuple[LinkableMetric, ...]] = {}
Expand All @@ -657,6 +660,7 @@ def _get_elements_in_semantic_model(self, semantic_model: SemanticModel) -> Link
"""Gets the elements in the semantic model, without requiring any joins.
Elements related to metric_time are handled separately in _get_metric_time_elements().
Linkable metrics are not considered local to the semantic model since they always require a join.
"""
linkable_dimensions = []
linkable_entities = []
Expand Down

0 comments on commit 054e26f

Please sign in to comment.