df_1
. You can use this variable for further processing in normal Python code blocks below. {{ variable_name }}
syntax. For example:inclause
keyword from jinjasql. As you can see below, we use a similar syntax as before but with this new keyword preceded by the |
symbol.sqlsafe
keyword as follows: %
character to represent optional substrings). To combine this with a variable value, use the following syntax:{% if condition } %{ endif }
, conditional blocks, or anything else that's supported by jinjasql. For example, the following block loops through a Python list (column_names
) to contruct the desired SQL fields.