Deprecation Warnings (coming soon in v1.10) #11493
graciegoheen
announced in
Announcements
Replies: 1 comment
-
There's a more specific list of deprecated behaviours in the tracking issue: #11335 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Historically, the inputs to your dbt project have been largely unconstrained. You can “configure” just about anything you want.
As one example of this, dbt currently allows you to set any custom yaml properties:
dbt sees that you’ve defined a custom property (
grace_is_cool
) that it does not recognize, and it silently continues.Without a set of strictly defined inputs, it’s much trickier to determine if a configuration in your dbt project is valid. This has created issues such as:
desciption:
instead ofdescription:
;materialization=
instead ofmaterialized=
)If you joined us for dbt developer day, you’ll know that starting in
v1.10
we will begin to emit deprecation warnings for future-invalid dbt code. This includes:{% endmacro %}
tag without a corresponding{% macro %}
tagSee the Github EPIC for more information.
How will we know what code is valid? (drum roll please...)
Better jsonschema validation for dbt yaml files
What is it?
Improvements to our jsonschemas which can statically analyze dbt yaml files and determine if they are valid. The new jsonschemas are:
Who’s it for?
Where can I check out these new & improved jsonschemas today?
For now, you can take a look at what we’re working on here:
When we’re confident that they’re ready for primetime, we’ll update the existing repository: dbt-labs/dbt-jsonschema
What’s Happening When?
We will start raising these warnings in dbt-core
v1.10
, but making these changes will not be prerequisite to usev1.10
. We know it will take existing users time to migrate their projects, and it is not our goal to break anyone overnight. The goal is to enable dbt users to work with more safety, feedback, and confidence going forward.What does this mean for you?
v1.10
, you should plan to update your invalid code soon! Even though it’s just a warning for now, in a future version of dbt, we will be enforcing stricter validation to the inputs of your dbt project. (@b-per is working on a tool you can use to autofix a lot of these).meta
config will be the only place to put custom user-defined attributes. Everything else will will be strongly typed and strictly validated. If you have an extra attribute you want to include in your project, or a model config you want to access in a custom materialization, you must nest it undermeta
moving forward.—-warn-error
flag (or--warn-error-options '{"error": "all"}'
) to promote all warnings to errors, this will include new deprecation warnings coming to Core. If you don’t want these to be promoted to errors, the--warn-error-options
flag gives you more granular control over exactly which types of warnings are treated as errors - you can set"warn": ["Deprecations"]
(new as of1.10
) to continue treating the deprecation warnings as warnings.By being stricter about what inputs are really used by dbt, and which ones are your own custom metadata, we can alert you about invalid inputs (like spelling errors) and prevent breaking changes to your projects!
Beta Was this translation helpful? Give feedback.
All reactions