brooklyn-data / dbt_artifacts

A dbt package for modelling dbt metadata. https://brooklyn-data.github.io/dbt_artifacts
Apache License 2.0
323 stars 119 forks source link

[Bug]: Error from snowflake__get_model_executions_dml_sql missing value #385

Closed kenpokiwi closed 1 year ago

kenpokiwi commented 1 year ago

Overview

When called following a failed call to a macro, the insert into model_executions generated is missing a value. "Inconsistent number of values in the VALUES clause expecting 16 but got 15".

How to reproduce

Build a model that calls a macro which raises a user defined compiler error "do exceptions.raise_compiler_error(err)" Call dbt_artifacts.upload_results(results) to upload results.

Expected behaviour

Generation of a valid insert statement with the required 16 values from the snowflake__get_model_executions_dml_sql macro.

Within the {% if model.timing != [] %} block need additional "{% else %} null" block for each {% for stage in model.timing if stage.name == "" %} to catch missing stage times within timing.

Screenshots

image

Environment

Results of running dbt --version: 1.6.2

1.6.2

Please paste the contents of your packages.yml file here:

packages:
    - package: dbt-labs/dbt_utils
    version: 1.1.0
  - package: dbt-labs/dbt_external_tables
    version: 0.8.0
  - package: dbt-labs/audit_helper
    version: 0.6.0
  - package: calogica/dbt_expectations
    version: 0.8.5
    # <see https://github.com/calogica/dbt-expectations/releases/latest> for the latest version tag
  - package: brooklyn-data/dbt_artifacts
    version: 2.5.0
kenpokiwi commented 1 year ago

Create PR: #386

glsdown commented 1 year ago

Thanks @kenpokiwi for this. This is a great spot - I'll get the PR reviewed now.