Closed wwzeng1 closed 1 year ago
💎 Sweep Pro: I used GPT-4 to create this ticket. You have 6 GPT-4 tickets left.
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
From looking through the relevant snippets, I decided to make the following modifications:
File Path | Proposed Changes |
---|---|
elementary/monitor/dbt_project/macros/tests/test_column_anomalies.sql |
Modify the check that validates if a column exists in the table. Specifically, unquote the column names before testing. This can be done by using the UNQUOTE_IDENTIFIER function provided by dbt. Replace the existing check with UNQUOTE_IDENTIFIER(column_name) IN (SELECT column_name FROM columns) . |
I have created a plan for writing the pull request. I am now working my plan and coding the required changes to address this issue. Here is the planned pull request:
[ELE-996] Fix column anomalies test for quoted column names
sweep/fix-column-anomalies-test
Description
This PR addresses issue ELE-996.
The issue occurs when the column names are quoted, causing a mismatch with the unquoted column names in the
test_column_anomalies.sql
file. This PR modifies the check in thetest_column_anomalies.sql
file to unquote the column names before testing. This ensures that the column names match regardless of whether they are quoted or not in the table.Changes Made
- Modified the check in
test_column_anomalies.sql
to unquote the column names before testing.- Replaced the existing check with
UNQUOTE_IDENTIFIER(column_name) IN (SELECT column_name FROM columns)
.Screenshots
N/A
Additional Context
I have finished coding the issue. I am now reviewing it for completeness.
Success! 🚀
I'm a bot that handles simple bugs and feature requests but I might make mistakes. Please be kind! Join Our Discord
Describe the bug We have a check here in which we read the table's columns and validate that the column you're testing actually exists. We're making the comparison with a quoted column on one side and an unquoted one on the other and hence the issue.
To Reproduce Add
quote: true
to a column.Solution We can solve this by doing one of two things:
Additional context
ELE-996