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

Allow snapshots to be defined in YAML. #10749

Closed
wants to merge 10 commits into from

Conversation

peterallenwebb
Copy link
Contributor

@peterallenwebb peterallenwebb commented Sep 20, 2024

Resolves #10246

Problem

Users had to awkwardly create jinja snapshot blocks in SQL files, even for very simple snapshots.

Solution

Delight users by allowing snapshots to be defined intuitively, with just a few lines of YAML.

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.

@peterallenwebb peterallenwebb requested a review from a team as a code owner September 20, 2024 15:10
@cla-bot cla-bot bot added the cla:yes label Sep 20, 2024
Copy link

codecov bot commented Sep 20, 2024

Codecov Report

Attention: Patch coverage is 92.85714% with 5 lines in your changes missing coverage. Please review.

Project coverage is 88.97%. Comparing base (054c6fd) to head (86cf015).
Report is 26 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10749      +/-   ##
==========================================
+ Coverage   88.95%   88.97%   +0.01%     
==========================================
  Files         181      181              
  Lines       22959    22977      +18     
==========================================
+ Hits        20424    20444      +20     
+ Misses       2535     2533       -2     
Flag Coverage Δ
integration 86.15% <90.00%> (+0.01%) ⬆️
unit 62.39% <38.57%> (+0.02%) ⬆️

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

Components Coverage Δ
Unit Tests 62.39% <38.57%> (+0.02%) ⬆️
Integration Tests 86.15% <90.00%> (+0.01%) ⬆️

mikealfare and others added 9 commits September 20, 2024 15:37
* add behavior deprecation snowplow callback
* update tests for new callback
* update test input with the new required field
* [tidy first] Replace `TestSelector` with `ResourceTypeSelector`

* Changelog entry

* Fully preserve current behavior

* Revert "Fully preserve current behavior"

This reverts commit ceecfec.
…environment variables for `dbt test` (#10706)

* Adding logic to TestSelector to remove unit tests if they are in excluded_resource_types

* Adding change log

* Respect `--resource-type` and `--exclude-resource-type` CLI flags and associated environment variables

* Test CLI flag for excluding unit tests for the `dbt test` command

* Satisy isort pre-commit hook

* Fix mypy for positional argument "resource_types" in call to "TestSelector"

* Replace `TestSelector` with `ResourceTypeSelector`

* Add co-author

* Update changelog description

* Add functional tests for new feature

* Compare the actual results, not just the count

* Remove test case covered elsewhere

* Test for `DBT_EXCLUDE_RESOURCE_TYPES` environment variable for `dbt test`

* Update per pre-commit hook

* Restore to original form (until we refactor extraneous `ResourceTypeSelector` references later)

---------

Co-authored-by: Matthew Cooper <asimov.1st@gmail.com>
…and `dbt build` (#10739)

* Remove duplicated constructor for `ResourceTypeSelector`

* Add type annotation for `ResourceTypeSelector`

* Standardize on constructor for `ResourceTypeSelector` where `include_empty_nodes=True`

* Changelog entry
@peterallenwebb
Copy link
Contributor Author

These changes were merged in a different PR.

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.

[Feature] No more jinja block for snapshots - new snapshot design ideas
4 participants