code: def lineage_run_id(task_instance: TaskInstance):
      """
      Macro function which returns the generated run id for a given task.
  
      This can be used to forward the run id from a task to a child run so the job hierarchy is preserved.
  
      .. seealso::
          For more information on how to use this operator, take a look at the guide:
          :ref:`howto/macros:openlineage`
      """
      return OpenLineageAdapter.build_task_instance_run_id(
          dag_id=task_instance.dag_id,
          task_id=task_instance.task.task_id,
          execution_date=task_instance.execution_date,
          try_number=task_instance.try_number,
      )
  
imports: from __future__ import annotations
  import os
  import typing
  from airflow.configuration import conf
  from airflow.providers.openlineage.plugins.adapter import OpenLineageAdapter
label_desc: Use image node_id 1 for calling a global function with example usage: lineage_run_id(task_instance) and returns: OpenLineageAdapter