Hey Elementary team!
Change to materialization search order
We're making a change to how dbt searches for implementations of the "builtin" materializations (view
, table
, etc). Previously, dbt would (implicitly) prefer adapter-specific implementations of materializations defined in packages over the out-of-the-box implementations within dbt, without the user necessarily knowing. We're changing this to be more explicit and less surprising.
I see that this package reimplements the table
and incremental
materializations. Starting with latest patch releases of dbt Core v1.6.14 and v1.7.14, users will see a deprecation message like the following:
$ dbt run -s my_table_model
16:41:27 Running with dbt=1.7.14
16:41:27 Registered adapter: snowflake=1.7.3
16:41:27 Found 31 models, 2 operations, 0 sources, 0 exposures, 0 metrics, 1232 macros, 0 groups, 0 semantic models
16:41:27
16:41:31
16:41:31 Running 1 on-run-start hook
16:41:31 1 of 1 START hook: elementary.on-run-start.0 ................................... [RUN]
16:41:31 1 of 1 OK hook: elementary.on-run-start.0 ...................................... [OK in 0.00s]
16:41:31
16:41:31 Concurrency: 8 threads (target='dev')
16:41:31
16:41:31 1 of 1 START sql table model dbt_jcohen_dev.my_table_model ..................... [RUN]
16:41:31 [WARNING]: Installed package 'elementary' is overriding the built-in
materialization 'table'. Overrides of built-in materializations from installed
packages will be deprecated in future versions of dbt. Please refer to https://d
ocs.getdbt.com/reference/global-configs/legacy-behaviors#require_explicit_packag
e_overrides_for_builtin_materializations for detailed documentation and
suggested workarounds.
16:41:33 1 of 1 OK created sql table model dbt_jcohen_dev.my_table_model ................ [SUCCESS 1 in 2.32s]
Proposal
I'd recommend updating the "Quickstart" guide in your documentation & package README, adding a step where users explicitly opt into the materialization overrides by adding the following code to a macros/
file in their root projects:
{% materialization table, adapter='snowflake' %}
{{ return(elementary.materialization_table_snowflake()) }}
{% endmaterialization %}
{% materialization incremental, adapter='incremental' %}
{{ return(elementary.materialization_table_snowflake()) }}
{% endmaterialization %}
(Replacing snowflake
with bigquery
, default
, etc as appropriate)
In the meantime, users can opt out of this behavior by setting this flag explicitly in their project files:
# dbt_project.yml
flags:
require_explicit_package_overrides_for_builtin_materializations: False
They will continue to see the deprecation warning.
Timeline
This flag was added (opt-in, disabled by default) in dbt Core v1.6.14 + v1.7.14.
The default value of this flag will be switching from False
to True
in dbt Core v1.8.0 (release candidate, final released planned for ~May 8) and dbt Cloud (~May 15).
References