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

[Bug] Fix scenario where dbt attempts to add existing columns to relations when using the SDK for column metadata #919

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mikealfare
Copy link
Contributor

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

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX

@mikealfare mikealfare self-assigned this Sep 27, 2024
@cla-bot cla-bot bot added the cla:yes label Sep 27, 2024
from dbt.tests.util import get_model_file, relation_from_name, set_model_file


def update_model(project, name: str, model: str) -> str:
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] dbt build fails when flag restrict_direct_pg_catalog_access set True
1 participant