Skip to content

[Bug] data issue building snapshots with both --empty and hard_deletes: invalidate #1329

@danielefrigo

Description

@danielefrigo

Is this a new bug?

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

Which packages are affected?

  • dbt-adapters
  • dbt-tests-adapter
  • dbt-athena
  • dbt-athena-community
  • dbt-bigquery
  • dbt-postgres
  • dbt-redshift
  • dbt-snowflake
  • dbt-spark

Current Behavior

Building a snapshot with hard_deletes: invalidate using the --empty flag closes the validity of all records.

Expected Behavior

Running dbt with --empty flag should not change the data in the target database

Steps To Reproduce

  1. build a snapshot and load some data, adding the hard_deletes: invalidate config
  2. load the snapshot with the --empty flag
  3. check the data in the database: all the records have been invalidated (i.e. have dbt_valid_to colum set to the current timestamp)

Relevant log output

Environment

- OS: Ubuntu 24.04 (WSL)
- Python: 3.12.3
- dbt-adapters: 1.9.1
- dbt-bigquery: 1.9.1

Additional Context

Looking in the logs, the snapshotted_data cter does not contain the filter that usually dbt adds to any ref/source

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage:productIn Product's queuetype:bugSomething isn't working as documented

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions