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

enable CTES in test defs #167

Merged
merged 11 commits into from
Nov 6, 2021
Merged

enable CTES in test defs #167

merged 11 commits into from
Nov 6, 2021

Conversation

dataders
Copy link
Collaborator

@dataders dataders commented Oct 14, 2021

fixes: #165
fixes: #172 172
fixes: #26
given the recent refactor of test in dbt-labs/dbt-core#3261 for v0.20.0, nested CTE definitions happened. For dbt-sqlserver users, this broke even ootb tests like accepted_values.

This PR addresses so test definitions of any complexity can now be used. 🎉

implementation differences

dbt core

  1. if
    1. store failures = True
      1. if does table exist currently
        1. drop it
      2. make new table
      3. add new table to list of relations
      4. define cte for test failure calcs
    2. store failures = False
  2. define cte for test failure calcs
  3. set the extra configs stuff
  4. create and execute the get_test_sql code

dbt-sqlserver

  1. if does table exist currently
    1. drop it
  2. make new table
  3. add new table to list of relations
  4. define cte for test failure calcs
  5. define cte for test failure calcs
  6. set the extra configs stuff
  7. create and execute the get_test_sql code
  8. if store failures=False
    1. drop the table

@dataders dataders linked an issue Nov 6, 2021 that may be closed by this pull request
@dataders dataders changed the base branch from master to v0.21.0 November 6, 2021 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant