code: def test_distinct_target_semantic_model_join_validation(
      simple_semantic_manifest_lookup: SemanticManifestLookup,
  ) -> None:
      """Tests semantic model join validation to a PRIMARY or UNIQUE entity.
  
      PRIMARY and UNIQUE entity targets should be valid for any join at the semantic model level because they both
      represent entity columns with distinct value sets, and as such there is no risk of inadvertent fanout joins.
      """
      semantic_model_references = (
          __get_simple_model_user_semantic_model_references_by_type(
              simple_semantic_manifest_lookup
          )
      )
      user_entity_reference = EntityReference(element_name="user")
      join_evaluator = SemanticModelJoinEvaluator(
          semantic_model_lookup=simple_semantic_manifest_lookup.semantic_model_lookup
      )
  
      foreign_primary = join_evaluator.is_valid_semantic_model_join(
          left_semantic_model_reference=semantic_model_references[
              EntityType.FOREIGN
          ],
          right_semantic_model_reference=semantic_model_references[
              EntityType.PRIMARY
          ],
          on_entity_reference=user_entity_reference,
      )
      primary_primary = join_evaluator.is_valid_semantic_model_join(
          left_semantic_model_reference=semantic_model_references[
              EntityType.PRIMARY
          ],
          right_semantic_model_reference=semantic_model_references[
              EntityType.PRIMARY
          ],
          on_entity_reference=user_entity_reference,
      )
      unique_primary = join_evaluator.is_valid_semantic_model_join(
          left_semantic_model_reference=semantic_model_references[
              EntityType.UNIQUE
          ],
          right_semantic_model_reference=semantic_model_references[
              EntityType.PRIMARY
          ],
          on_entity_reference=user_entity_reference,
      )
      foreign_unique = join_evaluator.is_valid_semantic_model_join(
          left_semantic_model_reference=semantic_model_references[
              EntityType.FOREIGN
          ],
          right_semantic_model_reference=semantic_model_references[
              EntityType.UNIQUE
          ],
          on_entity_reference=user_entity_reference,
      )
      primary_unique = join_evaluator.is_valid_semantic_model_join(
          left_semantic_model_reference=semantic_model_references[
              EntityType.PRIMARY
          ],
          right_semantic_model_reference=semantic_model_references[
              EntityType.UNIQUE
          ],
          on_entity_reference=user_entity_reference,
      )
      unique_unique = join_evaluator.is_valid_semantic_model_join(
          left_semantic_model_reference=semantic_model_references[
              EntityType.UNIQUE
          ],
          right_semantic_model_reference=semantic_model_references[
              EntityType.UNIQUE
          ],
          on_entity_reference=user_entity_reference,
      )
  
      results = {
          "foreign to primary": foreign_primary,
          "primary to primary": primary_primary,
          "unique to primary": unique_primary,
          "foreign to unique": foreign_unique,
          "primary to unique": primary_unique,
          "unique to unique": unique_unique,
      }
      assert all(results.values()), (
          f"All semantic model level join types for primary and unique targets should be valid, but we found "
          f"at least one that was not! Incorrectly failing types: {[k for k,v in results.items() if not v]}."
      )
  
file_path: metricflow/metricflow/test/model/semantics/test_semantic_model_join_evaluator.py
imports: from __future__ import annotations
  from typing import Dict, Sequence
  from dbt_semantic_interfaces.enum_extension import assert_values_exhausted
  from dbt_semantic_interfaces.protocols.entity import EntityType
  from dbt_semantic_interfaces.references import EntityReference, SemanticModelReference
  from metricflow.model.semantic_manifest_lookup import SemanticManifestLookup
  from metricflow.model.semantics.semantic_model_join_evaluator import SemanticModelEntityJoin, SemanticModelEntityJoinType, SemanticModelJoinEvaluator, SemanticModelLink
  from metricflow.test.fixtures.model_fixtures import ConsistentIdObjectRepository
label_desc: Use image node_id 4 for calling a global function with example usage: test_distinct_target_semantic_model_join_validation(simple_semantic_manifest_lookup) without return types