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

dbt-core 1.2 upgrade: BaseDocsGenerate and BaseDocsGenReferences #43

Closed
jlarue26 opened this issue Oct 24, 2022 · 0 comments
Closed

dbt-core 1.2 upgrade: BaseDocsGenerate and BaseDocsGenReferences #43

jlarue26 opened this issue Oct 24, 2022 · 0 comments
Assignees

Comments

@jlarue26
Copy link
Contributor

From dbt-labs/dbt-core#5468:

dbt-labs/dbt-core#5058 is another step along dbt-labs/dbt-core#4788 to the new framework in order to empower adapter maintainers and other contributors to make use of the same tests that the core team uses for their own adapters. Effectively, this test is validates an adapter's ability to correctly generate the catalog that serves as the static backend of a project docs site.
If your adapter does not add extra relation-level metadata (e.g. table size (rows + bytes), last modified timestamp) which is the case by default, then you can follow the same inherit and pass pattern to enable your version of BaseDocsGenerate and BaseDocsGenReferences. However, if you are supplementing the catalog with more metadata, you'll have to:

Add a method that defines stats for this adapter e.g. dbt-bigquerys
Reimplement the expected_catalog fixture, passing the above into model_stats and seed_stats
Example PRs:

dbt-labs/dbt-bigquery#190
dbt-labs/dbt-redshift#116

ravjotbrar added a commit that referenced this issue Nov 3, 2022
### Summary

Added these tests as part of the requirements for upgrading to dbt-core
1.2.

### Description
#### BaseDocsGenerate
- Modify second_model.sql to explicitly use alternate schema
- Modify models fixture to use our version of second_model.sql
- Modify verify_catalog from dbt-core to exclude source table
verification
- Modify unique_schema fixture to prepend schema with rav-test folder
- Modify project_config_update fixture to prevent the seed being created
as a view
- Modify profiles fixture to make root_path the same as schema
- Modify expected_catalog fixture to accommodate dremio data types
- Include test_run_and_generate methods so they use our version of
verify_catalog

#### BaseDocsGenReferences
- Modify project_config_update fixture to allow creating a view for
seeds. This is because the ephemeral_summary models looks for the seed
under database.schema (which is only used for views).
- Modify unique_schema, profiles, and expected catalog fixtures for same
reasons as above

#### Utilities
- Modify base_expected_catalog to look for datalake instead of database 
- Modify expected_references_catalog for the same reason above

#### Other
- Relevant imports
- Remove staging snapshot macro

### Related Issue

#43
#36

### Additional Reviewers

@jlarue26 
@ArgusLi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants