dagster-io / dagster

An orchestration platform for the development, production, and observation of data assets.
https://dagster.io
Apache License 2.0
11.91k stars 1.49k forks source link

[dagster-dbt] updates `default_code_version_fn` to take from dbt checksum if available #26071

Open marijncv opened 4 days ago

marijncv commented 4 days ago

Summary & Motivation

This updates the default_code_version_fn in dagster-dbt to read from dbt_resource_props["checksum"]["checksum"] if available (suggested here). This gives dbt seeds a valid model version.

An alternative implementation could be to always read from the checksum field and ignore the raw_sql and raw_code fields. This would simplify the code version getter, but this would cause all current code versions of dbt models to be updated. Perhaps something for a breaking release?

Closes https://github.com/dagster-io/dagster/issues/25947

How I Tested These Changes

Added test

Changelog

dagster-dbt now gives dbt seeds a valid code version