相关疑难解决方法(0)

Airflow:将{{ds}}作为参数传递给PostgresOperator

我想使用执行日期作为我的sql文件的参数:

我试过了

dt = '{{ ds }}'

s3_to_redshift = PostgresOperator(
    task_id='s3_to_redshift',
    postgres_conn_id='redshift',
    sql='s3_to_redshift.sql',
    params={'file': dt},
    dag=dag
)
Run Code Online (Sandbox Code Playgroud)

但它不起作用.

python scheduler airflow apache-airflow

12
推荐指数
1
解决办法
6533
查看次数

标签 统计

airflow ×1

apache-airflow ×1

python ×1

scheduler ×1