I am using the SnowflakeSqlApiOperator module for airflow. providers. snowflake. operators. snowflake. I executed an SQL and used parameters.

But I received an error :SQL compilation error:\nsyntax error line 104 at position 16 unexpected '%'.\nsyntax error line 104 at position 28 unexpected 's'.

enter image description here

1

There are 1 best solutions below

1
On
snowflake_task = SnowflakeSqlApiOperator(
    task_id="task_sqlapi",
    snowflake_conn_id  = 'snowflake_sqlapi__conn',
    sql ="select * from my_table where create_date = %(create_date)s",
    parameters = {'create_date' : '{{ ds_nodash }}'},
    )

This is the code I wrote