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.
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.
Expected behavior
I expect this to work. Potentially have the option to choose to create a view without with no schema binding.
Screenshots and log output
NA
System information
The output of dbt --version:
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!
The operating system you're using: Mac
The output of python --version: Python 3.12.4
Additional context
Upon closer look, this might not be a "bug", because in our project, we have:
models:
foobar:
+bind: False
However, I'd then expect an option in the command to not bind views.
Describe the bug
dbt clone
fails on Redshift because it creates a view withwith no schema binding
and tries to add comments on column, which is not supported.Steps To Reproduce
dbt clone --select "unsorted_data_history" --state latest_artefact/
with no schema binding
with no schema binding
view is not supported by Redshift (docs).with no schema binding
, everything works.Expected behavior
with no schema binding
.Screenshots and log output
System information
The output of
dbt --version
:The operating system you're using: Mac
The output of
python --version
: Python 3.12.4Additional context