This asnwers your question [How to pull xcom value from other task instance in the same DAG run (not the most recent one)? ]
See the example below :
t1 = SomeOperator(
task_id='Your_t1_Task_ID',
xcom_push = True,
...
...
dag=dag)
def get_records(**kwargs):
ti = kwargs['ti']
xcom = ti.xcom_pull(task_ids='Your_t1_Task_ID')
string_to_print = 'Value in xcom is: {}'.format(xcom)
#string_to_print holds that value, you can also print it in the logs
logging.info(string_to_print)
t2 = PythonOperator(
task_id='records',
provide_context=True,
python_callable=get_records,
dag=dag)
t1 >> t2
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…