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

Improve test FQNs #3259

Closed
jtcohen6 opened this issue Apr 13, 2021 · 1 comment
Closed

Improve test FQNs #3259

jtcohen6 opened this issue Apr 13, 2021 · 1 comment
Labels
dbt tests Issues related to built-in dbt testing functionality enhancement New feature or request

Comments

@jtcohen6
Copy link
Contributor

jtcohen6 commented Apr 13, 2021

Describe the feature

The FQNs for schema + data tests today are sort of silly, especially schema tests.

$ dbt ls --resource-type test
my_other_project.data_test.my_test
my_project.schema_test.accepted_values_model_a_id__1__2__3
my_project.subfolder.data_test.my_test
my_project.schema_test.my_test_model_a_

This means that, from the project file, these tests have to be configured sort of awkardly:

tests:
  my_project:
    schema_test:
      my_test_model_a_:
        +enabled: false
  my_other_project:
    data_test:
      +severity: warn

Ideally, we'd remove the data test / schema test nomenclature (#3234) and rationalize the FQNs.

  • Bespoke Singular test FQNs are straightforward: just project + file path
  • Generic test blocks: just project + name? Or fuller file-path FQNs?
  • Specific instantiations of generic tests: ideally, this might include target FQNs (e.g. my_project.models.subfolder.model_a.id.unique), to enable things like:
tests:
  models:
    subfolder:
      model_a:
        +enabled: false
        id:
          +enabled: true

But that may be overkill for the first cut of this! The main use case for configuring tests from dbt_project.yml is disabling/controlling behavior from a package. Maybe neater package-level FQNs is all we need.

In any case, we could start making the adjustments here:
https://github.com/fishtown-analytics/dbt/blob/7ec5c122e17ab7e1a5dd1e1cab36527159564a0f/core/dbt/parser/schemas.py#L439-L444

@jtcohen6 jtcohen6 added enhancement New feature or request dbt tests Issues related to built-in dbt testing functionality labels Apr 13, 2021
@jtcohen6 jtcohen6 added this to the Margaret Mead milestone Apr 13, 2021
@iknox-fa iknox-fa self-assigned this Apr 22, 2021
@iknox-fa iknox-fa removed their assignment May 3, 2021
@jtcohen6 jtcohen6 removed this from the Margaret Mead milestone Jun 2, 2021
@jtcohen6
Copy link
Contributor Author

resolved by #3880

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dbt tests Issues related to built-in dbt testing functionality enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants