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?
Summary & Motivation
This updates the
default_code_version_fn
indagster-dbt
to read fromdbt_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
andraw_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