class_docstr: Generator implementation class for SyncPipelineTaskGenerator.
class_docstr_tok: ["Generator","implementation","class","for","SyncPipelineTaskGenerator","."]
docstr: Returns task to abort pipeline execution.
code: def _abort_task(
      self, failed_nodes_dict: Mapping[str, status_lib.Status]
  ) -> task_lib.FinalizePipelineTask:
      """Returns task to abort pipeline execution."""
      logging.error(
          "Pipeline failed due to node failures. Failed nodes:\n%s",
          "\n".join(
              f"node_id: {node_id}, status: {status}"
              for node_id, status in failed_nodes_dict.items()
          ),
      )
      return task_lib.FinalizePipelineTask(
          pipeline_uid=self._pipeline_state.pipeline_uid,
          status=next(iter(failed_nodes_dict.values())),
      )
  
imports: import collections
  import textwrap
  from typing import Callable, Dict, List, Mapping, Optional, Set
  from absl import logging
  from tfx.orchestration import node_proto_view
  from tfx.orchestration.experimental.core import mlmd_state
  from tfx.orchestration.experimental.core import pipeline_state
  from tfx.orchestration.experimental.core import service_jobs
  from tfx.orchestration.experimental.core import task
  from tfx.orchestration.experimental.core import task_gen
  from tfx.orchestration.experimental.core import task_gen_utils
  from tfx.orchestration import mlmd_connection_manager
  from tfx.orchestration.portable.input_resolution import exceptions
  from tfx.orchestration.portable.mlmd import execution_lib
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.utils import status
  from tfx.utils import topsort
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 14 for calling the _Generator obj's underlying member method code with example usage: obj._abort_task(failed_nodes_dict) and returns: task_lib