-
Notifications
You must be signed in to change notification settings - Fork 59
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
[Bug] Fix scenario where dbt attempts to add existing columns to relations when using the SDK for column metadata #919
Conversation
from dbt.tests.util import get_model_file, relation_from_name, set_model_file | ||
|
||
|
||
def update_model(project, name: str, model: str) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was copy/pasted from other adapters. We should move it to dbt-tests-adapter
eventually, but that would complicate this PR. It should be done as a separate exercise.
…existing-columns' into pg-catalog-migration/fix-adding-existing-columns
@@ -28,6 +24,10 @@ def test_columns_in_relation(self, project, expected_columns): | |||
) | |||
with project.adapter.connection_named("_test"): | |||
actual_columns = project.adapter.get_columns_in_relation(my_relation) | |||
expected_columns = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are aliasing dtypes back to the original names, we don't need to specify the expected column dtypes based on whether the flag is enabled.
We elected to remove this functionality until we can resolve the discrepancy between our custom query and |
resolves #914
Problem
When using the
redshift_connector
SDK to collect metadata about a relation,dbt-redshift
attempts to add a column to a model which already exists on the model. This does not occur when using the legacy metadata query.Solution
Still investigating, but it appears this could be related to case sensitivity and/or quoting. Changing a column from unquoted to quoted on an incremental model results in the error that the user reported. However, this error also occurs when using the legacy metadata query.
Checklist