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

ADAP-891: Support test results as views #614

Merged
merged 9 commits into from
Oct 10, 2023

Conversation

mikealfare
Copy link
Contributor

@mikealfare mikealfare commented Sep 21, 2023

resolves dbt-labs/dbt-core#6914
docs dbt-labs/docs.getdbt.com/#

Problem

This will support persisting tests results as views. See the attached issue for more information.

Solution

Users can use strategy="view" in the config block in their dbt tests to create the test results as a view. This allows the results to update along with underlying data, e.g. when the underlying data is in a dynamic table.

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX

@mikealfare mikealfare requested a review from a team as a code owner September 21, 2023 21:46
@cla-bot cla-bot bot added the cla:yes label Sep 21, 2023
@mikealfare mikealfare self-assigned this Sep 21, 2023
@mikealfare mikealfare merged commit 1116e47 into main Oct 10, 2023
26 checks passed
@mikealfare mikealfare deleted the feature/materialized-tests/adap-891 branch October 10, 2023 23:05
abbywh pushed a commit to abbywh/dbt-redshift that referenced this pull request Oct 16, 2023
colin-rogers-dbt added a commit that referenced this pull request May 8, 2024
* adding SSO support for redshift

Committer: Abby Whittier <abbywhittier309@gmail.com>

* ADAP-891: Support test results as views (#614)

* implement store-failures-as tests

* Use the PID to terminate the session (#568)

* The first element of the result is the PID
* Debug-level logging of high-level message + SQL
* Using redshift_connector `cursor.fetchone()`  returns `(<something>,)`
* Use cursor to call `select pg_terminate_backend({pid})` directly rather than using the `SQLConnectionManager`

---------

Co-authored-by: Mike Alfare <13974384+mikealfare@users.noreply.github.com>

* added error checking for new optional user field

* black formatting

* move connection fixtures into the functional scope

* add iam user creds to the test.env template

* add test for database connection method

* add iam user auth test

* add IAM User auth test and second user auth method

* changie

* maintain existing behavior when not providing profile

* add AWS IAM profile

* pull in new env vars

* fixed env vars refs for CI

* move all repo vars to secrets

* split out connect method by connection method and provided information

* condition to produce just kwargs, consolidate connect method

* update .format to f-strings

* incorporate feedback from pr#630

* update kwargs logic flow

* updates to make space for iam role

* revert type on user

* revert test case decorator

* revert test case decorator

* revert error message

* add integration tests

* make space for both iam user and iam role in testing

* add role arn

* naming

* try supplying region for CI

* add region to CI env

* we can only support role credentials by profile

* move iam user specific config out of iam and into iam user

* add type annotations

* move iam defaults out of iam user

* add required params to test profiles

* add required params to test profiles

* simplify test files

* add expected fields back in

* split out unit test files

* split out unit test files

* add unit tests for iam role auth method

* standardize names

* allow for the default profile

* add unit tests for iam role access

* changie

* changie

---------

Co-authored-by: Abby Whittier <abbywhittier309@gmail.com>
Co-authored-by: Doug Beatty <44704949+dbeatty10@users.noreply.github.com>
Co-authored-by: colin-rogers-dbt <111200756+colin-rogers-dbt@users.noreply.github.com>
Co-authored-by: Anders <anders.swanson@dbtlabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CT-2070] [Feature] Materialized tests
2 participants