Skip to content

Commit

Permalink
Merge pull request #7 from SMeltser/dbt-labs-main
Browse files Browse the repository at this point in the history
Dbt labs main merge
  • Loading branch information
SMeltser authored Feb 28, 2022
2 parents 5a4a2d9 + a222df6 commit 920671e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,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))
- Fix table creation statement ordering when including both the BACKUP parameter as well as the dist/sort keys ([#23](https://github.com/dbt-labs/dbt-redshift/issues/60))
- 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)

Expand Down
4 changes: 3 additions & 1 deletion tests/integration/docs_generate_tests/test_docs_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -487,6 +488,7 @@ def rendered_seed_config(self, **updates):
'schema': None,
'alias': None,
'meta': {},
'unique_key': None
}
result.update(updates)
return result
Expand Down Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions tests/unit/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ def assert_has_keys(
'invocation_id',
'modules',
'flags',
'print'
})

REQUIRED_TARGET_KEYS = REQUIRED_BASE_KEYS | {'target'}
Expand Down Expand Up @@ -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

0 comments on commit 920671e

Please sign in to comment.