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

dbt clone fails on Redshift due to not being able to add comments to columns #937

Open
2 tasks done
jan-benisek opened this issue Oct 22, 2024 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working triage

Comments

@jan-benisek
Copy link

jan-benisek commented Oct 22, 2024

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

dbt clone fails on Redshift because it creates a view with with no schema binding and tries to add comments on column, which is not supported.

Expected Behavior

This should work automatically, disregarding with no schema binding in project settings:

# dbt_project.yaml
models:
  foobar:
    +bind: False
  • or have a flag to disable it in the command

Steps To Reproduce

  • Run dbt clone --select "unsorted_data_history" --state latest_artefact/
  • Error appears
10:39:34    Database Error in model unsorted_data_history (path/to/model/unsorted_data_history.sql)
  column "ts" of relation "unsorted_data_history" does not exist
  compiled Code at target/run/path/to/model/unsorted_data_history.sql
  • Which is because it creates a view with with no schema binding
create view "prod"."dev_foo"."unsorted_data_history__dbt_tmp" as (
    select * from "prod"."observability"."unsorted_data_history"
  ) with no schema binding;
  • Adding a comment to with no schema binding view is not supported by Redshift (docs).
  • If I omit the with no schema binding, everything works.

Relevant log output

No response

Environment

- OS: Mac
- Python: Python 3.12.4
- dbt:

Core:
  - installed: 1.8.6
  - latest:    1.8.7 - Update available!

  Your version of dbt-core is out of date!
  You can find instructions for upgrading here:
  https://docs.getdbt.com/docs/installation

Plugins:
  - redshift: 1.8.1 - Up to date!
  - postgres: 1.8.2 - Up to date!

Which database adapter are you using with dbt?

redshift

Additional Context

No response

@jan-benisek jan-benisek added bug Something isn't working triage labels Oct 22, 2024
@dbeatty10 dbeatty10 transferred this issue from dbt-labs/dbt-core Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

1 participant