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

Add not_empty_string test #634

Merged
merged 16 commits into from
Sep 14, 2022
Merged

Add not_empty_string test #634

merged 16 commits into from
Sep 14, 2022

Conversation

epapineau
Copy link
Contributor

@epapineau epapineau commented Aug 9, 2022

This is a:

  • documentation update
  • bug fix with no breaking changes
  • new functionality
  • a breaking change

All pull requests from community contributors should target the main branch (default).

Description & motivation

Resolves #632

Checklist

  • I have verified that these changes work locally on the following warehouses (Note: it's okay if you do not have access to all warehouses, this helps us understand what has been covered)
    • BigQuery
    • Postgres
    • Redshift
    • Snowflake
  • I followed guidelines to ensure that my changes will work on "non-core" adapters by:
    • dispatching any new macro(s) so non-core adapters can also use them (e.g. the star() source)
    • using the limit_zero() macro in place of the literal string: limit 0
    • using dbt_utils.type_* macros instead of explicit datatypes (e.g. dbt_utils.type_timestamp() instead of TIMESTAMP
  • I have updated the README.md (if applicable)
  • I have added tests & descriptions to my models (and macros if applicable)
  • I have added an entry to CHANGELOG.md

@epapineau epapineau mentioned this pull request Aug 9, 2022
@epapineau epapineau marked this pull request as ready for review August 25, 2022 19:29
@epapineau
Copy link
Contributor Author

We discussed on the original issue also adding a not_empty_array test, but I need to put more thought into what that would look like from a testing perspective (see core issue 2365). I wanted to get this out for review now though.

Copy link
Contributor

@joellabes joellabes left a comment

Choose a reason for hiding this comment

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

I like where this is going! Thank you for your patience 🙏 a couple of comments/questions where I'm not sure that I'm understanding it correctly, but otherwise let's get this merged

trim_whitespace: True
config:
severity: error
error_if: "<1"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should these be greater than signs?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, they shouldn't! This is a very clever way to force the tests to check the negative and positive case.

I really like this 🧠

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All credit goes to @dbeatty10 on this approach, but it feels good knowing that we're testing both the pass and fails.

integration_tests/models/sql/schema.yml Outdated Show resolved Hide resolved
Copy link
Contributor

@joellabes joellabes left a comment

Choose a reason for hiding this comment

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

@epapineau this looks great! just checking if you meant to change the postgres env vars?

integration_tests/.env/postgres.env Outdated Show resolved Hide resolved
@joellabes joellabes changed the base branch from main to utils-v1 September 14, 2022 03:18
@joellabes joellabes merged commit a733c4b into utils-v1 Sep 14, 2022
@joellabes joellabes deleted the feature/not_empty_string branch September 19, 2022 05:19
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.

not_blank test
2 participants