materialize icon indicating copy to clipboard operation
materialize copied to clipboard

dbt-materialize: migrate `materialize-dbt-utils` macros to core adapter

Open morsapaes opened this issue 3 years ago • 1 comments

dbt has announced that all macros in the dbt-utils package will be incorporated into dbt-core with the v1.2.0 release:

TL;DR: cross-db macros are in dbt-core now - yay! support for :point_up: will come in an 0.9.0 compatibility release dbt utils 1.0.0 make all our breaking changes so that we have a clean slate. Package maintainers can start to migrate off of utils any time from dbt Core 1.2's release date

For full context, see this discussion. This means that we'll no longer have to maintain the shimmed materialize-dbt-utils package, and can instead just override whatever macros differ from the dbt-postgres implementation. IIUC, we can also just move the dbt-audit-helper shims into the adapter repo, and keep everything in one place.

morsapaes avatar Jul 22 '22 09:07 morsapaes

(CC: @sjwiesman)

Logging some user feedback about dbt_utils.date_spine:

as an aside, looks like the dbt_utils function could be better implemented with generate_series:

materialize=> select generate_series(now(), now() + interval '3 days', interval '1 days');
generate_series|2022-08-09 19:57:37.429+00
generate_series|2022-08-10 19:57:37.429+00
generate_series|2022-08-11 19:57:37.429+00
generate_series|2022-08-12 19:57:37.429+00

In the process of porting things over, we should audit all macros to make sure that we're not just being compatible with dbt's implementation, but making them useful in the context of Materialize.

morsapaes avatar Aug 09 '22 21:08 morsapaes