Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More unstable indentation in multiline jinja #176

Closed
tconbeer opened this issue May 5, 2022 · 0 comments · Fixed by #180
Closed

More unstable indentation in multiline jinja #176

tconbeer opened this issue May 5, 2022 · 0 comments · Fixed by #180
Labels
bug Something isn't working
Milestone

Comments

@tconbeer
Copy link
Owner

tconbeer commented May 5, 2022

Describe the bug
Looks like #138 should not have been closed.

I suspect this is happening when jinjafmt is enabled, but black is not able to parse the string, so we abort formatting; we don't detect this today and probably need to handle this case and not modify the indentation (same as other instances where jinjafmt no-ops)

To Reproduce

...
         select
             {{
                 dbt_utils.star(
                      from=ref('prep_crm_user'),
                      except=['CREATED_BY','UPDATED_BY','MODEL_CREATED_DATE','MODEL_UPDATED_DATE','DBT_UPDATED_AT','DBT_CREATED_AT']                           
                )
             }}
         from {{ ref("prep_crm_user") }}
...

Expected behavior
This was produced by 0.8.0, so it should no-op

Actual behavior

...
         select
             {{
                 dbt_utils.star(
                              from=ref('prep_crm_user'),
                              except=['CREATED_BY','UPDATED_BY','MODEL_CREATED_DATE','MODEL_UPDATED_DATE','DBT_UPDATED_AT','DBT_CREATED_AT']                           
                        )
             }}
         from {{ ref("prep_crm_user") }}
...

Additional context
What is the output of sqlfmt --version?
0.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant