Open Cedric-Magnan opened 3 months ago
Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.
In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, please reach out through a comment on this PR.
CLA has not been signed by users: @Cedric-Magnan
Problem
If the
sql
string variable in therelations/view/create.sql
macro has multiple lines, the SQL view generated by dbt has one first line indented by 4 spaces, but the rest of the SQL code has no indentation.This does not respect SQLFluff best practices for indentation : https://docs.sqlfluff.com/en/stable/layout.html#indentation
Solution
By adding the Jinja2
indent
function : https://jinja.palletsprojects.com/en/3.1.x/templates/#jinja-filters.indentWe are able to indent all content from the
sql
variable (except the first line which is already indented) !Checklist