class_docstr: Base Recipe
class_docstr_tok: ["Base","Recipe"]
docstr: Runs a step in the recipe, or the entire recipe if a step is not specified.
  
  :param step: String name to run a step within the recipe. The step and its dependencies
               will be run sequentially. If a step is not specified, the entire recipe is
               executed.
  :return: None
docstr_tok: ["Runs","a","step","in","the","recipe",",","or","the","entire","recipe","if","a","step","is","not","specified",".",":","param","step",":","String","name","to","run","a","step","within","the","recipe",".","The","step","and","its","dependencies","will","be","run","sequentially",".","If","a","step","is","not","specified",",","the","entire","recipe","is","executed",".",":","return",":","None"]
code: def run(self, step: Optional[str] = None) -> None:
      """
      Runs a step in the recipe, or the entire recipe if a step is not specified.
  
      :param step: String name to run a step within the recipe. The step and its dependencies
                   will be run sequentially. If a step is not specified, the entire recipe is
                   executed.
      :return: None
      """
  
      # TODO Record performance here.
      self._steps = self._resolve_recipe_steps()
      target_step = (
          self._get_step(step) if step else self._get_default_step()
      )
      last_executed_step = run_recipe_step(
          self._recipe_root_path,
          self._get_subgraph_for_target_step(target_step),
          target_step,
          self._recipe,
      )
  
      self.inspect(last_executed_step.name)
  
      # Verify that the step execution succeeded and throw if it didn't.
      last_executed_step_output_directory = get_step_output_path(
          self._recipe_root_path, last_executed_step.name, ""
      )
      last_executed_step_state = last_executed_step.get_execution_state(
          last_executed_step_output_directory
      )
      if last_executed_step_state.status != StepStatus.SUCCEEDED:
          last_step_error_mesg = (
              f"The following error occurred while running step '{last_executed_step}':\n"
              f"{last_executed_step_state.stack_trace}\n"
              f"Last step status: '{last_executed_step_state.status}'\n"
          )
          if step is not None:
              raise MlflowException(
                  f"Failed to run step '{step}' of recipe '{self.name}':\n{last_step_error_mesg}",
                  error_code=BAD_REQUEST,
              )
          else:
              raise MlflowException(
                  f"Failed to run recipe '{self.name}':\n{last_step_error_mesg}",
                  error_code=BAD_REQUEST,
              )
  
imports: import abc
  import logging
  import os
  from typing import List, Optional
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_pb2 import BAD_REQUEST, INTERNAL_ERROR, INVALID_PARAMETER_VALUE
  from mlflow.recipes import dag_help_strings
  from mlflow.recipes.artifacts import Artifact
  from mlflow.recipes.step import BaseStep, StepClass, StepStatus
  from mlflow.recipes.utils import get_recipe_config, get_recipe_name, get_recipe_root_path
  from mlflow.recipes.utils.execution import clean_execution_state, get_or_create_base_execution_directory, get_step_output_path, run_recipe_step
  from mlflow.recipes.utils.step import display_html
  from mlflow.utils.class_utils import _get_class_from_string
label_desc: Use image node_id 4 for calling the BaseRecipe obj's underlying member method code with example usage: obj.run(step) without return types