-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Allow instances of generic data tests to be documented #2578
Comments
I would say that for me a
|
I know we've discussed putting schema tests in the tests directory instead of the macros directory, but I don't recall what the resolution of that was. Is that on the roadmap somewhere? |
@gshank @kwigley I'd like to use our discussion of this issue as a jumping-off point to discuss other test-related work we scoped out earlier this year, and to determine whether / which of these should go on the v1.0 list as well. The ones that come to my mind are:
All of those would represent a breaking change to some degree. There's ways we can offer backwards compatibility; easier for some, harder for others. |
Work:
|
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue, or it will be closed in 7 days. |
I think the ticket activity doesn't reflect the demand for this feature, there has been at least 6 users asking about in on Slack this past year: https://getdbt.slack.com/archives/CBSQTAPLG/p1631304882432300 It might be because the wording used in the ticket has changed: I think custom tests are code as much as models and macros are, so documenting them is equally important.
IMO, having the static description as is in written in the YAML without replacing the values would already be nice and useful, the more complex version could be kept for later. |
I came to +1 this post. Looking forward to support for documenting Singular Tests. Thanks! |
+1 from me too. |
+1 from my side as well. It's quite important to be able to document what a test does. |
+1 from me as well. |
+1 from me too. |
+1 |
+1 |
@jomccr Please note that generic tests can be documented as a Macro (inside You can create a As an example I'm providing the file [1]:
[2]:
|
This documents your test "as a macro" >> but is the same documentation generated when you view the test, linked in the model documentation? |
## Summary & Motivation According to the problem [Adding descriptions to tests is no longer possible from 0.20.0](dbt-labs/dbt-core#3599 ) and the source code [SchemaGenericTestParser](https://github.com/dbt-labs/dbt-core/blob/main/core/dbt/parser/schema_generic_tests.py#L39) the general test does not support the description in the schema. This fix allows users to define a test description in `tests/<generic test>/config/meta/description`, to display data in Dagster(UI) Asset Check. ```yaml models: - name: wildberries_incomes tests: - name: 'Equal_row_count_with_stg__wildberries_incomes' config: meta: description: "Equal rows before join with mapping table" test_name: equal_rowcount compare_model: source('production', 'stg__wildberries_incomes') compare_model_final: True ``` Related: dbt-labs/dbt-core#2578 ![Снимок экрана 2024-01-29 в 14 57 45](https://github.com/dagster-io/dagster/assets/34104577/2638a04c-935f-4368-b21b-04c5de740614) ## How I Tested These Changes pytest Co-authored-by: Rex Ledesma <[email protected]>
## Summary & Motivation According to the problem [Adding descriptions to tests is no longer possible from 0.20.0](dbt-labs/dbt-core#3599 ) and the source code [SchemaGenericTestParser](https://github.com/dbt-labs/dbt-core/blob/main/core/dbt/parser/schema_generic_tests.py#L39) the general test does not support the description in the schema. This fix allows users to define a test description in `tests/<generic test>/config/meta/description`, to display data in Dagster(UI) Asset Check. ```yaml models: - name: wildberries_incomes tests: - name: 'Equal_row_count_with_stg__wildberries_incomes' config: meta: description: "Equal rows before join with mapping table" test_name: equal_rowcount compare_model: source('production', 'stg__wildberries_incomes') compare_model_final: True ``` Related: dbt-labs/dbt-core#2578 ![Снимок экрана 2024-01-29 в 14 57 45](https://github.com/dagster-io/dagster/assets/34104577/2638a04c-935f-4368-b21b-04c5de740614) ## How I Tested These Changes pytest Co-authored-by: Rex Ledesma <[email protected]>
+1 to be able to add descriptions to singular tests |
I have finally got this to work in dbt cloud but it is not obvious. My generic test (macro) is called check_row_count_not_zero and is stored under tests/generic. To document this I have to update the macros.yml in the macros folder, note the name has to have the prefix test_
With this the documentation now shows Description |
+1 to be able to add descriptions to singular tests |
1 similar comment
+1 to be able to add descriptions to singular tests |
+1 to be able to add descriptions to singular tests |
@dbeatty10 , this thread makes me wonder, what is the official way dbt Labs tracks feature requests? Most platforms have an idea page with an upvote count and their product team works on the most upvoted ideas. In this case, everyone is randomly "+1"ing and there's no way for anyone to tell this is a popular idea. Should we be doing something else? |
Opened a new issue in dbt-labs/docs.getdbt.com: dbt-labs/docs.getdbt.com#6293 |
Describe the feature
Currently, you can document pretty much everything but a data test - if you try, it fails on a parsing error. This ticket is for generic data tests. A separate ticket addresses singular data tests: #9005
Acceptance criteria
Examples
Concerns
The text was updated successfully, but these errors were encountered: