Apply column quoting to unit tests #202
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
resolves #205
Note
This is just a prototype of a potential solution, and I probably won't finish it.
Anyone that wants to take it across the finish line in a separate PR and feel free to take any of it that is useful.
Problem
Unit tests do not currently take quoting of column names into account.
Solution
Make sure the locations below are all using quoted column names:
dbt-adapters/dbt/include/global_project/macros/materializations/tests/helpers.sql
Line 27 in d831caa
dbt-adapters/dbt/include/global_project/macros/materializations/tests/helpers.sql
Line 35 in d831caa
dbt-adapters/dbt/include/global_project/macros/unit_test_sql/get_fixture_sql.sql
Line 31 in df1b8c3
dbt-adapters/dbt/include/global_project/macros/unit_test_sql/get_fixture_sql.sql
Line 40 in df1b8c3
dbt-adapters/dbt/include/global_project/macros/unit_test_sql/get_fixture_sql.sql
Line 56 in df1b8c3
Testing
Here is a potential functional test for this scenario
dbt-tests-adapter/dbt/tests/adapter/unit_testing/test_case_sensitivity.py
Checklist