Skip to content

Commit

Permalink
Safe cast field to INT to avoid failure on casting error (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedrad authored Oct 8, 2022
1 parent 781a8f8 commit 34b5936
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion macros/upload_model_executions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
{% endif %}

{{ model.execution_time }}, {# total_node_runtime #}
'{{ model.adapter_response.rows_affected }}', {# rows_affected #}
try_cast('{{ model.adapter_response.rows_affected }}' as int), {# rows_affected #}
'{{ model.node.config.materialized }}', {# materialization #}
'{{ model.node.schema }}', {# schema #}
'{{ model.node.name }}' {# name #}
Expand Down
2 changes: 1 addition & 1 deletion macros/upload_seed_executions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
{% endif %}

{{ model.execution_time }}, {# total_node_runtime #}
'{{ model.adapter_response.rows_affected }}', {# rows_affected #}
try_cast('{{ model.adapter_response.rows_affected }}' as int), {# rows_affected #}
'{{ model.node.config.materialized }}', {# materialization #}
'{{ model.node.schema }}', {# schema #}
'{{ model.node.name }}' {# name #}
Expand Down
2 changes: 1 addition & 1 deletion macros/upload_snapshot_executions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
{% endif %}

{{ model.execution_time }}, {# total_node_runtime #}
'{{ model.adapter_response.rows_affected }}', {# rows_affected #}
try_cast('{{ model.adapter_response.rows_affected }}' as int), {# rows_affected #}
'{{ model.node.config.materialized }}', {# materialization #}
'{{ model.node.schema }}', {# schema #}
'{{ model.node.name }}' {# name #}
Expand Down

0 comments on commit 34b5936

Please sign in to comment.