Skip to content

Commit bef5a69

Browse files
committed
change location of description column
for backwards compatibility the description column needs to go on the end, as dbt adds it there to existing tables
1 parent 0a8e638 commit bef5a69

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

macros/upload_tests.sql

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
{{ adapter.dispatch('column_identifier', 'dbt_observability')(2) }},
2121
{{ adapter.dispatch('column_identifier', 'dbt_observability')(3) }},
2222
{{ adapter.dispatch('column_identifier', 'dbt_observability')(4) }},
23-
{{ adapter.dispatch('column_identifier', 'dbt_observability')(5) }},
24-
{{ adapter.dispatch('parse_json', 'dbt_observability')(adapter.dispatch('column_identifier', 'dbt_observability')(6)) }},
23+
{{ adapter.dispatch('parse_json', 'dbt_observability')(adapter.dispatch('column_identifier', 'dbt_observability')(5)) }},
24+
{{ adapter.dispatch('column_identifier', 'dbt_observability')(6) }},
2525
{{ adapter.dispatch('column_identifier', 'dbt_observability')(7) }},
26-
{{ adapter.dispatch('column_identifier', 'dbt_observability')(8) }},
26+
{{ adapter.dispatch('parse_json', 'dbt_observability')(adapter.dispatch('column_identifier', 'dbt_observability')(8)) }},
2727
{{ adapter.dispatch('parse_json', 'dbt_observability')(adapter.dispatch('column_identifier', 'dbt_observability')(9)) }},
28-
{{ adapter.dispatch('parse_json', 'dbt_observability')(adapter.dispatch('column_identifier', 'dbt_observability')(10)) }}
28+
{{ adapter.dispatch('column_identifier', 'dbt_observability')(10) }}
2929
from values
3030

3131
{% endif %}
@@ -42,12 +42,12 @@
4242
'{{ test.unique_id }}', {# node_id #}
4343
'{{ run_started_at }}', {# run_started_at #}
4444
'{{ test.name }}', {# name #}
45-
'{{ test_description }}', {# description #}
4645
'{{ tojson(test.depends_on.nodes) }}', {# depends_on_nodes #}
4746
'{{ test.package_name }}', {# package_name #}
4847
'{{ test.original_file_path | replace('\\', '\\\\') }}', {# test_path #}
4948
'{{ tojson(test.tags) }}', {# tags #}
50-
'{{ null if test.test_metadata is not defined else adapter.dispatch('escape_singlequote', 'dbt_observability')(tojson(test.test_metadata)) }}' {# test.test_metadata #}
49+
'{{ null if test.test_metadata is not defined else adapter.dispatch('escape_singlequote', 'dbt_observability')(tojson(test.test_metadata)) }}', {# test.test_metadata #}
50+
'{{ test_description }}' {# description #}
5151
)
5252
{%- if not loop.last %},{%- endif %}
5353
{%- endfor %}
@@ -72,12 +72,12 @@
7272
'{{ test.unique_id }}', {# node_id #}
7373
'{{ run_started_at }}', {# run_started_at #}
7474
'{{ test.name }}', {# name #}
75-
'{{ test_description }}', {# description #}
7675
{{ tojson(test.depends_on.nodes) }}, {# depends_on_nodes #}
7776
'{{ test.package_name }}', {# package_name #}
7877
'{{ test.original_file_path | replace('\\', '\\\\') }}', {# test_path #}
7978
{{ tojson(test.tags) }}, {# tags #}
80-
parse_json('{{ tojson(test.test_metadata) }}') {# test_metadata #}
79+
parse_json('{{ tojson(test.test_metadata) }}'), {# test_metadata #}
80+
'{{ test_description }}' {# description #}
8181
)
8282
{%- if not loop.last %},{%- endif %}
8383
{%- endfor %}

models/sources/tests.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ select
1414
cast(null as {{ type_string() }}) as node_id,
1515
cast(null as {{ type_timestamp() }}) as run_started_at,
1616
cast(null as {{ type_string() }}) as name,
17-
cast(null as {{ type_string() }}) as description,
1817
cast(null as {{ type_array() }}) as depends_on_nodes,
1918
cast(null as {{ type_string() }}) as package_name,
2019
cast(null as {{ type_string() }}) as test_path,
2120
cast(null as {{ type_array() }}) as tags,
22-
cast(null as {{ type_json() }}) as test_metadata
21+
cast(null as {{ type_json() }}) as test_metadata,
22+
cast(null as {{ type_string() }}) as description
2323
from dummy_cte
2424
where 1 = 0

0 commit comments

Comments
 (0)