diff --git a/CHANGELOG.md b/CHANGELOG.md index d9b97d78b..46293bf31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### Fixes - Fix test related to preventing coercion of boolean values (True,False) to numeric values (0,1) in query results ([#58](https://github.com/dbt-labs/dbt-redshift/blob/1.0.latest/CHANGELOG.md)) +- Add unique\_id field to docs generation test catalogs; a follow-on PR to core PR ([#4168](https://github.com/dbt-labs/dbt-core/pull/4618)) and core PR ([#4701](https://github.com/dbt-labs/dbt-core/pull/4701)) ## dbt-redshift 1.0.0 (December 3, 2021) diff --git a/tests/integration/docs_generate_tests/test_docs_generate.py b/tests/integration/docs_generate_tests/test_docs_generate.py index a952f44b3..3112c4e91 100644 --- a/tests/integration/docs_generate_tests/test_docs_generate.py +++ b/tests/integration/docs_generate_tests/test_docs_generate.py @@ -463,6 +463,7 @@ def rendered_model_config(self, **updates): 'full_refresh': None, 'on_schema_change': 'ignore', 'meta': {}, + 'unique_key': None } result.update(updates) return result @@ -487,6 +488,7 @@ def rendered_seed_config(self, **updates): 'schema': None, 'alias': None, 'meta': {}, + 'unique_key': None } result.update(updates) return result @@ -515,7 +517,7 @@ def rendered_snapshot_config(self, **updates): 'check_cols': 'all', 'unique_key': 'id', 'target_schema': None, - 'meta': {}, + 'meta': {} } result.update(updates) return result diff --git a/tests/unit/test_context.py b/tests/unit/test_context.py index 7adf9b3de..550ca0e3c 100644 --- a/tests/unit/test_context.py +++ b/tests/unit/test_context.py @@ -183,6 +183,7 @@ def assert_has_keys( 'invocation_id', 'modules', 'flags', + 'print' }) REQUIRED_TARGET_KEYS = REQUIRED_BASE_KEYS | {'target'} @@ -451,20 +452,20 @@ def test_resolve_specific(config, manifest_extended, redshift_adapter, get_inclu # macro_a exists, but default__macro_a and redshift__macro_a do not with pytest.raises(dbt.exceptions.CompilationException): ctx['adapter'].dispatch('macro_a').macro - + # root namespace is always preferred, unless search order is explicitly defined in 'dispatch' config assert ctx['adapter'].dispatch('some_macro').macro is package_rs_macro assert ctx['adapter'].dispatch('some_macro', 'dbt').macro is package_rs_macro assert ctx['adapter'].dispatch('some_macro', 'root').macro is package_rs_macro - + # override 'dbt' namespace search order, dispatch to 'root' first ctx['adapter'].config.dispatch = [{'macro_namespace': 'dbt', 'search_order': ['root', 'dbt']}] assert ctx['adapter'].dispatch('some_macro', macro_namespace = 'dbt').macro is package_rs_macro - + # override 'dbt' namespace search order, dispatch to 'dbt' only ctx['adapter'].config.dispatch = [{'macro_namespace': 'dbt', 'search_order': ['dbt']}] assert ctx['adapter'].dispatch('some_macro', macro_namespace = 'dbt').macro is rs_macro - + # override 'root' namespace search order, dispatch to 'dbt' first ctx['adapter'].config.dispatch = [{'macro_namespace': 'root', 'search_order': ['dbt', 'root']}] assert ctx['adapter'].dispatch('some_macro', macro_namespace = 'root').macro is rs_macro