Commit 6d7ff51 Claire Carroll
authored
File tree 2 files changed +11
-2
lines changed
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 142
142
from {{tmp_relation .include (schema= False)}}
143
143
);
144
144
{%- endcall %}
145
- {%- set rows_inserted = (load_result(' main-' ~ i)[' status' ].split(" " ))[2 ] | int - %}
145
+ {% set result = load_result(' main-' ~ i) %}
146
+ {% if ' response' in result .keys () %} {# added in v0.19.0 #}
147
+ {% set rows_inserted = result[' response' ][' rows_affected' ] %}
148
+ {% else %} {# older versions #}
149
+ {% set rows_inserted = result[' status' ].split(" " )[2 ] | int %}
150
+ {% endif %}
151
+
146
152
{%- set sum_rows_inserted = loop_vars[' sum_rows_inserted' ] + rows_inserted - %}
147
153
{%- if loop_vars .update ({' sum_rows_inserted' : sum_rows_inserted}) %} {% endif - %}
148
154
165
171
166
172
{%- set status_string = " INSERT " ~ loop_vars[' sum_rows_inserted' ] - %}
167
173
168
- {% call noop_statement(name = ' main' , status = status_string) - %}
174
+ {% call noop_statement(' main' , status_string) - %}
169
175
-- no-op
170
176
{%- endcall %}
171
177
Original file line number Diff line number Diff line change @@ -24,5 +24,8 @@ if [[ ! -z $3 ]]; then _seeds="--select $3 --full-refresh"; fi
24
24
25
25
dbt deps --target $1
26
26
dbt seed --target $1 $_seeds
27
+ if [ $1 == ' redshift' ]; then
28
+ dbt run -x -m test_insert_by_period --full-refresh --target redshift
29
+ fi
27
30
dbt run -x --target $1 $_models
28
31
dbt test -x --target $1 $_models
You can’t perform that action at this time.
0 commit comments