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

Clarify --strict flag usage #337

Merged
merged 2 commits into from
Aug 17, 2020
Merged

Clarify --strict flag usage #337

merged 2 commits into from
Aug 17, 2020

Conversation

jtcohen6
Copy link
Collaborator

Description & motivation

I've seen this question crop up a few times in dbt Slack. Based on the current language in the docs, it sounds like --strict does strict field validation (dbt-labs/dbt-core#1570), rather than what it really does, which is nothing special since v0.15.0.

Let me know if I'm missing a technical piece of this.

Pre-release docs

Is this change related to an unreleased version of dbt?

  • Yes
  • No (if you're not sure, it's probably "No")

The `-S` or `--strict` flag runs schema validations on dbt objects at runtime. This flag may incur a performance penalty, but it is useful for catching logic errors in development of the dbt project.
The `-S` or `--strict` flag runs schema validations on dbt python objects at runtime. This flag may incur a performance penalty, but it is useful for catching logic errors in development of the dbt project.

**N.B.** In versions >=0.15.0, dbt uses [hologram](https://github.com/fishtown-analytics/hologram) and [mypy](http://mypy-lang.org/) for object type declaration, validation, and testing. The `--strict` flag has no functional use except as an alias for `--warn-error`. We may choose to someday repurpose it.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think if it truly is functionally the same as --warn-error we should use that as the entire description, ya know?

The -S or --strict flag is equivalent to the --warn-error flag. We may choose to someday repurpose it.

The `-S` or `--strict` flag runs schema validations on dbt objects at runtime. This flag may incur a performance penalty, but it is useful for catching logic errors in development of the dbt project.
The `-S` or `--strict` flag runs schema validations on dbt python objects at runtime. This flag may incur a performance penalty, but it is useful for catching logic errors in development of the dbt project.

**N.B.** In versions >=0.15.0, dbt uses [hologram](https://github.com/fishtown-analytics/hologram) and [mypy](http://mypy-lang.org/) for object type declaration, validation, and testing. The `--strict` flag has no functional use except as an alias for `--warn-error`. We may choose to someday repurpose it.
Copy link
Contributor

Choose a reason for hiding this comment

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

There are a couple things strict does:

  • we do an extra validate call in some paths when you set --strict. This can be really slow as it requires serializing the object to json to validate it.
  • Connections type checks
  • some internal consistency checks during compilation

There's still no reason users should use --strict over --warn-error. We should rename the flags so --strict is just an alias for --warn-error and --strict becomes --strict-development-checks or something similarly verbose and obnoxious. You should only run it automatically via integration tests anyway.

@jtcohen6
Copy link
Collaborator Author

Thanks for the comments, both!

@beckjake I think that re-aliasing makes sense.

For now, I made this a bit more concise, with the basic message of "don't use this."

@clrcrl clrcrl self-requested a review August 17, 2020 14:54
@jtcohen6 jtcohen6 merged commit 407098d into current Aug 17, 2020
@jtcohen6 jtcohen6 deleted the fix/strict-flag-clarify-use branch August 17, 2020 15:13
nghi-ly pushed a commit that referenced this pull request Feb 13, 2024
REPO SYNC - Public to Private
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.

3 participants