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] Leave model intact when uploading #415

Closed whiteh closed 5 months ago

whiteh commented 6 months ago

Overview

When models are uploaded, the raw_code attribute is dropped - presumably for size concerns. This can cause problems with other DBT packages that expect this attribute to be present.

This PR shifts the model uploading macros to work on copies of the model object, rather than the original. This should mean that any changes won't affect the use of these object elsewhere.

Update type - breaking / non-breaking

What does this solve?

Incompatibility with other DBT packages. See issue https://github.com/brooklyn-data/dbt_artifacts/issues/414

Outstanding questions

What databases have you tested with?

I'm unable to test this, but we have patched this fix in to our DBT codebase already.

whiteh commented 5 months ago

Just noticed I've missed a model object. I'll push a fix now.

jared-rimmer commented 5 months ago

Just noticed I've missed a model object

No worries. I'll wait for a fix and then re-run the tests

whiteh commented 5 months ago

Should be good now 👍. Sorry about that. Glad I re-read it.

I missed the tojson(model) calls which were the important ones. Can't see any references to the model object in that file now.