brooklyn-data / dbt_artifacts

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

[Bug]: 'dict object' has no attribute 'raw_code' - incompatibility with other packages #414

Closed whiteh closed 5 months ago

whiteh commented 6 months ago

Overview

We are seeing some incompatibilities with testing modules that rely on the raw_code attribute. It looks like this is popped from the models during upload through dbt_artifacts.

How to reproduce

  1. Run dbt compile
  2. All dbt_artifacts uploads work fine
  3. Receive error `Compilation Error in test {test_name} ({test_path}) 'dict object' has no attribute 'raw_code'
  4. This property is popped from each uploaded model in dbt_artifacts here

Expected behaviour

  1. Other processes subsequent to dbt_artifacts upload should finish successfully.
  2. dbt_artifacts should not edit the model object

Screenshots

Environment

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

packages:
  packages:
  - package: brooklyn-data/dbt_artifacts
    version: 2.6.1
  - git: "https://github.com/EqualExperts/dbt-unit-testing"
    revision: v0.3.2
whiteh commented 6 months ago

I have a fix for this in our code base - I'll open a PR shortly.

jared-rimmer commented 5 months ago

Resolved in #415 and will be in the next release. Thanks for the contribution @whiteh