title: Airflow: how to access running task from task instance?
body: <p>This is my situation:</p>
  
  <p>I am trying to access the instance of my custom operator running in another DAG. I am able to get the correct DagRun and TaskInstance objects by doing the following.</p>
  
  <pre><code>dag_bag = DagBag(settings.DAGS_FOLDER)
  target_dag = dag_bag.get_dag('target_dag_id')
  dr = target_dag.get_dagrun(target_dag.latest_execution_date)
  ti = dr.get_task_instance('target_task_id')
  </code></pre>
  
  <p>I have printed the TaskInstance object aquired by the above lines and it is correct (it is running/has the correct task_id etc.), however when I am unable to access the task object, which would allow me to interface with the running operator. I should be able to do the following:</p>
  
  <p><code>running_custom_operator = ti.task #AttributeError: TaskInstance has not attribute task</code></p>
  
  <p>Any help would be much appreciated, either following my approach or if someone knows how to access the task object of a running task instance.</p>
  
  <p>Thank you</p>