class_docstr: An end to end test using fully orchestrated Airflow.
class_docstr_tok: ["An","end","to","end","test","using","fully","orchestrated","Airflow","."]
docstr: Get a task state as a string.
docstr_tok: ["Get","a","task","state","as","a","string","."]
code: def _GetState(self, task_name: str) -> str:
      """Get a task state as a string."""
      try:
          output = subprocess.check_output(
              [
                  "airflow",
                  "tasks",
                  "state",
                  self._dag_id,
                  task_name,
                  self._execution_date,
              ]
          ).split()
          # Some logs are emitted to stdout, so we take the last word as state.
          return tf.compat.as_str(output[-1])
      except subprocess.CalledProcessError:
          # For multi-processing, state checking might fail because database lock
          # has not been released. 'none' will be treated as a pending state, so
          # this state checking will be retried later.
          return "none"
  
imports: import os
  import platform
  import subprocess
  import time
  from typing import Sequence, Set
  import unittest
  import absl
  import tensorflow
  from tfx.dsl.io import fileio
  from tfx.orchestration.airflow import test_utils
  from tfx.tools.cli.e2e import test_utils
  from tfx.utils import io_utils
  from tfx.utils import test_case_utils
label_desc: Use image node_id 1 for calling the AirflowEndToEndTest obj's underlying member method code with example usage: obj._GetState(task_name) and returns: tf, str