raphaelauv commented on PR #35844:
URL: https://github.com/apache/airflow/pull/35844#issuecomment-1826044862
@Taragolis
thanks for the advise , it work but it mean 2 operators and it's "less
friendly"
```python
def build_sql(date):
return "select * from job where dag_id !=
'{date}'".format(date=date)
build_sql_task = PythonOperator(
task_id="build_sql",
python_callable=build_sql,
op_kwargs={"date": "{{ds}}"})
run_sql_task = SQLExecuteQueryOperator(
task_id="toto",
conn_id="airflow_db",
sql="{{ task_instance.xcom_pull(task_ids='build_sql') }}"
)
build_sql_task >> run_sql_task
build_sql_task.as_setup()
```
if this pattern is considered the preferable solution then I could at least
create a PR to add an example , wdyt ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]