Skip to content

Commit

Permalink
Make method public since it's used in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb committed Apr 17, 2024
1 parent 21d8572 commit 352771f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions metricflow/model/semantics/linkable_spec_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,9 +899,7 @@ def _get_joined_elements(self, measure_semantic_model: SemanticModel) -> Linkabl

return LinkableElementSet.merge_by_path_key((single_hop_elements, multi_hop_elements))

def _get_all_linkable_metrics_for_semantic_model(
self, starting_semantic_model: SemanticModel
) -> LinkableElementSet:
def get_all_linkable_metrics_for_semantic_model(self, starting_semantic_model: SemanticModel) -> LinkableElementSet:
"""Get all metrics that can be joined to this semantic model using up to the max allowed join hops."""
linkable_metrics = LinkableElementSet()

Expand Down Expand Up @@ -946,7 +944,7 @@ def _get_linkable_element_set_for_measure(
elements_in_semantic_model = self._get_elements_in_semantic_model(measure_semantic_model)
metric_time_elements = self._get_metric_time_elements(measure_reference)
joined_elements = self._get_joined_elements(measure_semantic_model)
linkable_metrics = self._get_all_linkable_metrics_for_semantic_model(measure_semantic_model)
linkable_metrics = self.get_all_linkable_metrics_for_semantic_model(measure_semantic_model)

return LinkableElementSet.merge_by_path_key(
(
Expand Down
2 changes: 1 addition & 1 deletion tests/model/test_semantic_model_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def test_linkable_metrics_for_semantic_model( # noqa: D103
request=request,
mf_test_configuration=mf_test_configuration,
set_id="result0",
linkable_element_set=metric_lookup._linkable_spec_resolver._get_all_linkable_metrics_for_semantic_model(
linkable_element_set=metric_lookup._linkable_spec_resolver.get_all_linkable_metrics_for_semantic_model(
measure_semantic_model
),
)
Expand Down

0 comments on commit 352771f

Please sign in to comment.