class_docstr: Container with access to the dbt artifacts required to power the MetricFlow CLI.
  
  In order to avoid double-loading this should generally be built from the dbtProjectMetadata struct.
  This does not inherit because it is a slightly different struct. In most cases this is the object
  we want to reference.
class_docstr_tok: ["Container","with","access","to","the","dbt","artifacts","required","to","power","the","MetricFlow","CLI",".","In","order","to","avoid","double-loading","this","should","generally","be","built","from","the","dbtProjectMetadata","struct",".","This","does","not","inherit","because","it","is","a","slightly","different","struct",".","In","most","cases","this","is","the","object","we","want","to","reference","."]
docstr: Loads adapter and semantic manifest associated with the previously-fetched project metadata.
docstr_tok: ["Loads","adapter","and","semantic","manifest","associated","with","the","previously-fetched","project","metadata","."]
code: def load_from_project_metadata(
      cls: Type[Self], project_metadata: dbtProjectMetadata
  ) -> Self:
      """Loads adapter and semantic manifest associated with the previously-fetched project metadata."""
      # dbt's get_adapter helper expects an AdapterRequiredConfig, but `project` is missing cli_vars
      # In practice, get_adapter only actually requires HasCredentials, so we replicate the type extraction
      # from get_adapter here rather than spinning up a full RuntimeConfig instance
      # TODO: Move to a fully supported interface when one becomes available
      adapter = get_adapter_by_type(
          project_metadata.profile.credentials.type
      )
      semantic_manifest = (
          dbtArtifacts.build_semantic_manifest_from_dbt_project_root(
              project_root=project_metadata.project_path
          )
      )
      return cls(
          profile=project_metadata.profile,
          project=project_metadata.project,
          adapter=adapter,
          semantic_manifest=semantic_manifest,
      )
  
imports: from __future__ import annotations
  import dataclasses
  import logging
  from pathlib import Path
  from typing import List, Type
  from dbt.adapters.base.impl import BaseAdapter
  from dbt.adapters.factory import get_adapter_by_type
  from dbt.cli.main import dbtRunner
  from dbt.config.profile import Profile
  from dbt.config.project import Project
  from dbt.config.runtime import load_profile, load_project
  from dbt_semantic_interfaces.pretty_print import pformat_big_objects
  from dbt_semantic_interfaces.protocols.semantic_manifest import SemanticManifest
  from typing_extensions import Self
  from metricflow.errors.errors import ModelCreationException
  from metricflow.model.dbt_manifest_parser import parse_manifest_from_dbt_generated_manifest
label_desc: Use image node_id 1 for calling the dbtArtifacts obj's underlying member method code with example usage: obj.load_from_project_metadata(cls, project_metadata) and returns: cls