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

Make comment safety check less sensitive to whitespace changes #434

Closed
tconbeer opened this issue Jun 8, 2023 · 0 comments · Fixed by #436
Closed

Make comment safety check less sensitive to whitespace changes #434

tconbeer opened this issue Jun 8, 2023 · 0 comments · Fixed by #436
Labels
bug Something isn't working

Comments

@tconbeer
Copy link
Owner

tconbeer commented Jun 8, 2023

This fails the safety check, because we first replace the -- and THEN get rid of whitespace. Need to flip that order.

-{#-- We must add a fake join key in case additional grouping variables are not provided --#}
-{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}
-{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}
-{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}
-{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}
+    {#- - We must add a fake join key in case additional grouping variables are not provided --#}
+    {#- - Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}
+    {#- - The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}
+    {% set group_by_columns = ["id_dbtutils_test_fewer_rows_than"] + group_by_columns %}
+    {% set groupby_gb_cols = "group by " + group_by_columns | join(",") %}

Additional context
What is the output of sqlfmt --version?
v0.18.3

@tconbeer tconbeer added the bug Something isn't working label Jun 8, 2023
@tconbeer tconbeer changed the title Don't do anything inside jinja comment blocks Make comment safety check less sensitive to whitespace changes Jun 8, 2023
tconbeer added a commit that referenced this issue Jun 8, 2023
tconbeer added a commit that referenced this issue Jun 8, 2023
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