dbt-labs / dbt-redshift

dbt-redshift contains all of the code enabling dbt to work with Amazon Redshift

Home Page:https://getdbt.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] Add test for 9682 in core

VersusFacit opened this issue · comments

Is this a new bug in dbt-redshift?

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

Current Behavior

  1. No test for this core fix.

  2. Replace macros for materialized view generate SQL. Currently the create statement is missing from what is sent to Redshift which leads to query empty error.

Example of bad query:

        backup yes
        diststyle even
        
        
        auto refresh no
    as (
        select * from "xxx"."xxx"."my_seed"
    );

Sample logs of test failure here

tests/functional/adapter/materialized_view_tests/test_materialized_views.py::TestRedshiftMaterializedViewsBasic::test_materialized_view_replaces_table
tests/functional/adapter/materialized_view_tests/test_materialized_views.py::TestRedshiftMaterializedViewsBasic::test_materialized_view_replaces_view
tests/functional/test_autocommit.py::TestAutocommitUnblocksDDLInTransactions::test_default_setting_allows_DDL
tests/functional/adapter/test_basic.py::TestIncrementalRedshift::test_incremental
tests/functional/adapter/test_constraints.py::TestRedshiftTableConstraintsRollback::test__constraints_enforcement_rollback
tests/functional/adapter/test_constraints.py::TestRedshiftIncrementalConstraintsRollback::test__constraints_enforcement_rollback
tests/functional/test_autocommit.py::TestTransactionBlocksPreventCertainCommands::test_autocommit_deactivated_prevents_DDL
tests/functional/adapter/test_persist_docs.py::TestPersistDocsLateBinding::test_comment_on_late_binding_view

Expected Behavior

Have a test for the internal variables!

Proper materialized view SQL generates and passes the tests.

Steps To Reproduce

To trigger the test failure, integrate the fix here into your branch, then watch integration tests fail. Open logger and you'll find the malformed query that jumps straight to backup without a create predicate.

Relevant log output

No response

Environment

- OS:
- Python:
- dbt-core:
- dbt-redshift:

Additional Context

No response

Hey @VersusFacit, moving this to unestimated, but should it be in progress in a sprint?

Re-opening for backport