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

[Bug] Restored deleted items are not appearing in dbt Snapshots 1.9 #11269

Open
2 tasks done
paritoshg2010 opened this issue Feb 4, 2025 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working snapshots Issues related to dbt's snapshot functionality triage

Comments

@paritoshg2010
Copy link

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

In dbt-core 1.9, with dbt snapshot new feature to capture the new records for the deleted items, I have noticed that if the deleted records are restored, those are not reinserted in snapshot table.

snapshot config:

strategy='check',

hard_deletes= 'new_record'

As you see in the attached screenshot, the deleted record entry is the last entry in this table.

Image

Expected Behavior

Once the records are restored, the deleted entry (is_deleted='True') in snapshot table should be invalidated and the new record will be created.

Steps To Reproduce

  1. Run dbt snapshot on any table, to replicate all the records from monitored table.
  2. Now delete one record from monitored table & run the dbt snapshot on that table. There will be new entry created for the deleted record with the previous one getting invalidated and the new one with dbt_is_deleted='True'.
  3. Now again try to restore that delete record in the monitored table, and run the dbt snapshot on it. The new entry for the restored item is not getting create in snapshot table.

Relevant log output

Environment

- OS: macOS Sonoma ver 14.6.1
- Python: 3.11.8
- dbt-core: 1.9.1
- dbt-adapters: dbt-snowflake 1.9

Which database adapter are you using with dbt?

snowflake

Additional Context

No response

@paritoshg2010 paritoshg2010 added bug Something isn't working triage labels Feb 4, 2025
@paritoshg2010 paritoshg2010 changed the title [Bug] <title> Restored deleted items are not appearing in dbt Snapshots 1.9 [Bug] Restored deleted items are not appearing in dbt Snapshots 1.9 Feb 4, 2025
@dbeatty10 dbeatty10 added the snapshots Issues related to dbt's snapshot functionality label Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working snapshots Issues related to dbt's snapshot functionality triage
Projects
None yet
Development

No branches or pull requests

2 participants