dbt-labs / dbt-core

dbt enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications.
https://getdbt.com
Apache License 2.0
10.03k stars 1.64k forks source link

[Feature] Raise an error when a custom `dbt_valid_to_current` is configured for a pre-existing snapshot #10923

Open dbeatty10 opened 1 month ago

dbeatty10 commented 1 month ago

Is this your first time submitting a feature request?

Describe the feature

The dbt_valid_to_current config is intended for net-new snapshots rather than being applied to snapshots that already exist (i.e., the relevant table exists in the database). The reason is that dbt is not supplying automated migration paths (https://github.com/dbt-labs/dbt-core/issues/10325), and its up to users to migrate in the best way they see fit.

So similar to https://github.com/dbt-labs/dbt-core/issues/10185 for the snapshot_meta_column_names config, dbt should throw an error if the user has an existing snapshot and they try to add/change the dbt_valid_to_current config.

Describe alternatives you've considered

No response

Who will this benefit?

No response

Are you interested in contributing this feature?

No response

Anything else?

No response

graciegoheen commented 1 month ago

this should error on insert if you change the meta field names

This config doesn't change the name of the meta fields. It changes the value that means "current" for the dbt_valid_to field. How could we throw an error in that case?