code: def test_single_task_error() -> None:
      """Check that an error is properly returned in the results if a task errors out."""
      task = NoOpExecutionPlanTask(should_error=True)
      execution_plan = ExecutionPlan("plan0", leaf_tasks=[task])
      executor = SequentialPlanExecutor()
      results = executor.execute_plan(execution_plan)
      assert len(results.get_result(task.task_id).errors) == 1
      assert (
          results.get_result(task.task_id).errors[0]
          == NoOpExecutionPlanTask.EXAMPLE_ERROR
      )
  
file_path: metricflow/metricflow/test/execution/test_sequential_executor.py
imports: from __future__ import annotations
  from metricflow.execution.execution_plan import ExecutionPlan
  from metricflow.execution.executor import SequentialPlanExecutor
  from metricflow.test.execution.noop_task import NoOpExecutionPlanTask
label_desc: Use image node_id 2 for calling a global function with example usage: test_single_task_error() without return types