Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Update ignore behaviour for on_schema_change to backfill nulls for removed columns, instead of failing #10733

Open
3 tasks done
joellabes opened this issue Sep 18, 2024 · 0 comments
Labels
enhancement New feature or request incremental Incremental modeling with dbt triage

Comments

@joellabes
Copy link
Contributor

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature

When a column is removed from an incremental model, and its on_schema_change behaviour is set to ignore, it should backfill a null instead of failing.

@RatandeepSharma recently opened dbt-labs/docs.getdbt.com#5978 in the docs repo after being confused by on_schema_change: ignore failing when a column is removed. While investigating that, I tripped over dbt-labs/dbt-bigquery#1102 (comment), which proposed:

  • A new classic mode, wired as the current ignore mode
  • Fixing ignore to actually ignore removed columns
on_schema_change In case of new columns... In case of removed columns...
classic columns ignored run failed
ignore columns ignored columns ignored [i.e. insert null]
fail run failed run failed
append_new_columns columns added columns ignored [i.e. insert null]
sync_all_columns columns added columns removed

I agree that we should make it so that ignore doesn't cause the job to fail, but I don't think we need a whole new classic option anymore. Since that comment in early 2023, we've added support for behaviour change flags. I think that instead of adding the classic option, we just change the default behaviour of ignore to insert nulls and let people opt into the old behaviour if they depend on it.

Describe alternatives you've considered

Still adding a new mode. But given our commitment to backwards compatibility, we'd need to keep ignore behaving the same way and come up with a new name for the new behaviour, otherwise we'd have to go through a behaviour change flag anyway.

Who will this benefit?

People who don't want to drop a column after removing it from their model.

Are you interested in contributing this feature?

Not really, but it's incremental season right now so I bet someone could give it a gander!

Anything else?

No response

@joellabes joellabes added enhancement New feature or request triage labels Sep 18, 2024
@dbeatty10 dbeatty10 added the incremental Incremental modeling with dbt label Sep 19, 2024
@dbeatty10 dbeatty10 changed the title [Feature] Update ignore behaviour for on_schema_change to backfill nulls for removed columns, instead of failing [Feature] Update ignore behaviour for on_schema_change to backfill nulls for removed columns, instead of failing Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request incremental Incremental modeling with dbt triage
Projects
None yet
Development

No branches or pull requests

2 participants