Skip to content
Advertisement

Tag: jinja2

How to add a Jinja function to .sqlfluff config

I’m using the jinja functions run_query and execute. https://docs.getdbt.com/reference/dbt-jinja-functions/run_query But when sqlfluff lint I get the following error: Undefined jinja template variable: ‘run_query’ I’m trying to add it to the .sqlfluff config but there doesn’t seem to be any guidance anywhere on how to add this to the config file. Any help would be greatly appreciated! Thanks Answer Add templater=dbt

For loop in Jinja2 splitting the chars in nested list, instead of returning whole of nested list

My doubts list is [[‘a’,’b’,’This is a sentence’]] My HTML (Jinja) is My Flask is :- x is giving a,b,T,h,i,s,i,s,a,s,e,n,t,e,n,c,e [Each char one iteration] I expected a,b,This is a sentence. [Only one iteration] How do I resolve this? Thanks in advance! Answer You have dumped the output to json for some reason. Don’t do that. Pass the value of cursor.fetchall()

Advertisement