How to support Airflow jinja template in sqlfluff

I want to run sqlfluff fix command to this sql file. This SQL is for Snowflake and will be executed in Airflow. ti.xcom_pull is a function used in Airflow DAG.

DELETE FROM test
WHERE date = '';    

then I got this error in fix command.

L:   1 | P:   1 |  TMP | Unrecoverable failure in Jinja templating: 'ti' is
                       | undefined. Have you configured your variables?
                       | https://docs.sqlfluff.com/en/latest/configuration.html

This means that sqlfluff does not directly support Airflow template and we have to provide variable for ti.xcom_pull. How can I do it?



Comments

Popular posts from this blog

I get wrong characters when retreiving the message body of an email using TIdIMAP4.UIDRetrieveTextPeek2()

How to drop the all the 1's in a correlation matrix

Today Walkin 14th-Sept