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

Filter data in tests #78

Merged
merged 3 commits into from
Aug 22, 2024
Merged

Filter data in tests #78

merged 3 commits into from
Aug 22, 2024

Conversation

amishas157
Copy link
Contributor

PR Checklist

PR Structure

  • This PR has reasonably narrow scope (if not, break it down into smaller PRs).
  • This PR avoids mixing refactoring changes with feature changes (split into two PRs
    otherwise).
  • This PR's title starts with the jira ticket associated with the PR.

Thoroughness

  • This PR adds tests for the most critical parts of the new functionality or fixes.
  • I've updated the docs and README with the added features, breaking changes, new instructions on how to use the repository.

Release planning

  • I've decided if this PR requires a new major/minor/patch version accordingly to
    semver, and I've changed the name of the BRANCH to release/* , feature/* or patch/* .

What

In our effort to optimize tests, this PR:

  • Adds filters in test for incremental models
  • Remove unique tests for certain models as they are already defined unique in SQL config. Example:

{{
config(
tags = ["current_state"],
materialized = "incremental",
unique_key = "unique_id",
cluster_by = ["asset_code", "asset_issuer"]
)
}}

Why

To optimize test runs and make pipelines robust

Known limitations

None. Tested on Test airflow

@amishas157 amishas157 requested a review from a team as a code owner August 22, 2024 15:49
@@ -426,6 +426,8 @@ models:
- accepted_values:
values: [true, false]
quote: false
config:
where: closed_at > current_timestamp - interval 2 day
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I'm pretty sure the accepted_values test can be removed. This field is a boolean (only possible values are true, false, null) and there is already a not_null check

Copy link
Contributor Author

@amishas157 amishas157 Aug 22, 2024

Choose a reason for hiding this comment

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

Where would boolean check be enforced though? Is there a schema validator? I think bigquery should be able to enforce it

@amishas157 amishas157 merged commit 0e4f931 into master Aug 22, 2024
3 checks passed
@sydneynotthecity sydneynotthecity deleted the patch/add-filter-in-tests branch November 14, 2024 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants