z3z1ma / dbt-osmosis

Provides automated YAML management, a dbt server, streamlit workbench, and git-integrated dbt model output diff tools
https://z3z1ma.github.io/dbt-osmosis/
Apache License 2.0
456 stars 46 forks source link

`compiled_sql` renamed to `compiled_code` from dbt 1.3 onwards #14

Closed b-per closed 1 year ago

b-per commented 2 years ago

Hi! I just wanted to mention that from dbt version 1.3 onwards, the field compiled_sql from manifest.json has been renamed to compiled_code (to be relevant for Python models as well).

I tried the integration of dbt-osmosis into dbt PowerUser on a repo with 1.3b and got errors when I wanted to preview the data.

Happy to create a PR to cater for compiled_code if you want me to!

z3z1ma commented 1 year ago

Thanks for the issue!

I am on a roll with the v2 of the dbt-osmosis server so I went ahead and introduced a compat change in the just released version, 0.8.1 that factors in that change in the dbt api. Accessor calls are now dynamic based on the below global

DBT_MAJOR_VER, DBT_MINOR_VER, DBT_PATCH_VER = (int(v) for v in dbt_version.split("."))
COMPILED_ATTR = "compiled_code" if DBT_MAJOR_VER >= 1 and DBT_MINOR_VER >= 3 else "compiled_sql"

Please upgrade if needed and let me know how it goes! Closing the issue in the meantime.