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

Fix #2578: Allow instances of generic data tests to be documented #10850

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

aranke
Copy link
Member

@aranke aranke commented Oct 14, 2024

Resolves #2578

Problem

Not being able to document instances of generic data tests has been a longstanding paper cut.

Solution

Allow documenting instances of generic data tests, e.g.

- name: color
  tests:
    - accepted_values:
        values: ['blue', 'green', 'red']
        description: "{{ doc('color_accepted_values') }}"

Tests implemented:

  • Setting description as a string
  • No description set, defaults to ""
  • Description can be set via doc block

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 or 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.
  • This PR includes type annotations for new and modified functions.

@cla-bot cla-bot bot added the cla:yes label Oct 14, 2024
Copy link

codecov bot commented Oct 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.13%. Comparing base (40c350f) to head (22c8d63).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10850      +/-   ##
==========================================
- Coverage   89.18%   89.13%   -0.06%     
==========================================
  Files         183      183              
  Lines       23429    23433       +4     
==========================================
- Hits        20895    20886       -9     
- Misses       2534     2547      +13     
Flag Coverage Δ
integration 86.36% <100.00%> (-0.13%) ⬇️
unit 62.12% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Unit Tests 62.12% <100.00%> (+<0.01%) ⬆️
Integration Tests 86.36% <100.00%> (-0.13%) ⬇️

@aranke aranke marked this pull request as ready for review October 14, 2024 20:41
@aranke aranke requested a review from a team as a code owner October 14, 2024 20:41
Copy link
Contributor

@gshank gshank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@aranke aranke merged commit cd6bb9e into main Oct 15, 2024
69 of 70 checks passed
@aranke aranke deleted the fix_2578 branch October 15, 2024 17:53
@aranke aranke added the user docs [docs.getdbt.com] Needs better documentation label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes user docs [docs.getdbt.com] Needs better documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow instances of generic data tests to be documented
2 participants