我正在使用postgresql运算符。任务如下:
emailage_transformations = PostgresOperator(
task_id = 'emailage_transformations',
sql = '/home/ubuntu/airflow_ci/current/scripts/antifraud/emailage_transformations.sql',
postgres_conn_id = 'redshift',
autocommit = True,
dag = dag)
起初,文件的内容是下一个:
^{pr2}$我得到的错误是
jinja2.exceptions.TemplateNotFound: /home/ubuntu/airflow_ci/current/scripts/antifraud/emailage_transformations.sql
因此,我在查询中添加了几个括号,以符合jinja2模板,现在文件代码是:
{select cd_pedido_nr,fraud_score,risk_band,ip_risk_level
into antifraud.stg_emailage_id_pedido
from antifraud.stg_emailage_id_email e
left join antifraud.info_emails i on id_email = cd_email_nr
;}
然而,我仍然有同样的错误。我该怎么解决呢?在
我在下面的链接中告诉您,您应该向您的DAG提供一个^{} ,以便它能够拾取您的外部文件(SQL或其他文件)
另外,使外部文件可发现,例如by modifying ^{} 或通过other tricks也可以工作
相关问题 更多 >
编程相关推荐