-
Notifications
You must be signed in to change notification settings - Fork 950
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
Conversation
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
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." |
REPO SYNC - Public to Private
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?