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

Fix docs generation integration test #70

Merged
merged 4 commits into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this addition needed b/c of this PR dbt-labs/dbt-core#4701?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If so, I'm guessing the other adapters might need this update as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was. I'll merge this PR and look at the others

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doubled checked snowflake, bigquery, and spark. The unit tests of those are passing just fine! No additional fixes needed for this issue looks like. 😄

})

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