class_docstr: Tfx runner on Airflow.
class_docstr_tok: ["Tfx","runner","on","Airflow","."]
code: def _replace_runtime_params(self, comp):
      for k, prop in comp.exec_properties.copy().items():
          if isinstance(prop, RuntimeParameter):
              # Airflow only supports string parameters.
              if prop.ptype != str:
                  raise RuntimeError(
                      f"RuntimeParameter in Airflow does not support {prop.ptype}. The"
                      "only ptype supported is string."
                  )
  
              # If the default is a template, drop the template markers when inserting
              # it into the .get() default argument below. Otherwise, provide the
              # default as a quoted string.
              if prop.default.startswith(
                  "{{"
              ) and prop.default.endswith("}}"):
                  default = prop.default[2:-2]
              else:
                  default = json.dumps(prop.default)
  
              # TODO(b/186118336): Once we move to Airflow 2.0, we should instead use
              # the airflow.models.DagParam class.
              template_field = '{{ dag_run.conf.get("%s", %s) }}' % (
                  prop.name,
                  default,
              )
              comp.exec_properties[k] = template_field
      return comp
  
imports: import os
  import typing
  from typing import Any, Dict, Optional, Union
  import warnings
  from airflow import models
  from tfx.dsl.components.base import base_component
  from tfx.orchestration import pipeline
  from tfx.orchestration import tfx_runner
  from tfx.orchestration.airflow import airflow_component
  from tfx.orchestration.config import config_utils
  from tfx.orchestration.config import pipeline_config
  from tfx.orchestration.data_types import RuntimeParameter
  from tfx.utils.json_utils import json
label_desc: Use image node_id 3 for calling the AirflowDagRunner obj's underlying member method code with example usage: obj._replace_runtime_params(comp) and returns: comp