1

I have saved values in xcom (key='db_value') in xcom in one of the airflow task. in one of the later step I need to save same value in Bigquery table. Can you please suggest, how can I prepare SQL to update/insert table with XCOM values appended in SQL string and then pass same to BashOperator or PythonOperator or BigqueryOperator. I tried using python callable or BigqueryOperator, but since task_instance.xcom_pull is not available till operator is executed, I am not able to prepare SQL before hand to provide same in param.

Any suggestions.

Nitesh
  • 490
  • 3
  • 6
  • 15

1 Answers1

0

I am finally able to solve the issue. I have used approach provided here. Had to execute another operator (BashOperator) inside PythonOperator. Otherwise I wasnt able to prepare SQL using xcom_pull values

Nitesh
  • 490
  • 3
  • 6
  • 15