Skip to content

Commit fc0ff9b

Browse files
committed
Stamp dbt_spellbook provenance and explicit public/visible on spell properties
Set dune.created_by=dbt_spellbook, dune.public, and dune.visible in the four shared property macros (mark_as_spell, expose_spells, hide_spells, expose_dataset) so that every spell lands with an explicit provenance tag and visibility state on the Dune catalog service. The baseline mark_as_spell applies to every model via the project-level post-hook; expose_spells/hide_spells/expose_dataset override as before. Also document the dbt Cloud and CI runner profile changes required for the catalog service migration, since they cannot be configured via this repo. Towards DWH-317
1 parent 7031d7b commit fc0ff9b

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

dbt_macros/dune/config_trino_properties.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
{%- endif -%}
1515
{%- if target.name == 'prod' -%}
1616
{%- set properties = {
17+
'dune.created_by': 'dbt_spellbook',
1718
'dune.public': 'true',
19+
'dune.visible': 'true',
1820
'dune.data_explorer.blockchains': blockchains | as_text,
1921
'dune.data_explorer.category': 'abstraction',
2022
'dune.data_explorer.abstraction.type': spell_type,
@@ -37,7 +39,9 @@
3739
{% macro hide_spells() %}
3840
{%- if target.name == 'prod' -%}
3941
{%- set properties = {
42+
'dune.created_by': 'dbt_spellbook',
4043
'dune.public': 'false',
44+
'dune.visible': 'false',
4145
'dune.data_explorer.category': 'abstraction',
4246
'dune.vacuum': '{"enabled":true}'
4347
} -%}

dbt_macros/dune/expose_dataset.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{% macro expose_dataset(blockchains, contributors) %}
22
{%- if target.name == 'prod' -%}
33
{%- set properties = {
4+
'dune.created_by': 'dbt_spellbook',
45
'dune.public': 'true',
6+
'dune.visible': 'true',
57
'dune.data_explorer.blockchains': blockchains | as_text,
68
'dune.data_explorer.category': 'third_party_data',
79
'dune.data_explorer.contributors': contributors | as_text,

dbt_macros/dune/mark_as_spell.sql

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
{% macro mark_as_spell(this, materialization) %}
22
{%- if target.name == 'prod' -%}
33
{%- if model.config.materialized == "view" -%}
4-
{%- set properties = { 'dune.data_explorer.category': 'abstraction' } -%}
4+
{%- set properties = {
5+
'dune.created_by': 'dbt_spellbook',
6+
'dune.public': 'true',
7+
'dune.visible': 'false',
8+
'dune.data_explorer.category': 'abstraction'
9+
} -%}
510
{%- else -%}
6-
{%- set properties = { 'dune.data_explorer.category': 'abstraction', 'dune.vacuum': '{"enabled":true}' } -%}
11+
{%- set properties = {
12+
'dune.created_by': 'dbt_spellbook',
13+
'dune.public': 'true',
14+
'dune.visible': 'false',
15+
'dune.data_explorer.category': 'abstraction',
16+
'dune.vacuum': '{"enabled":true}'
17+
} -%}
718
{%- endif -%}
819
{%- set deprecated_at = model.config.get('deprecated_at', none) -%}
920
{%- if deprecated_at -%}

0 commit comments

Comments
 (0)