dbt-labs / dbt-labs/dbt

[CT-2701] Snapshot dbt_updated_at not updated

Open
#7,869 8 comments 1 reaction 0 assignees View on GitHub
behavior_change_flag engine:v1 snapshots type:docs
Dominant language
Rust
Stars
13.8k
Forks
2.6k
Avg merge
21h 31m
Merged PRs (30d)
56

Description

### Is this a new bug in dbt-core?

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

### Current Behavior

This was brought up by a customer and I am kinda surprised I have never heard this before.

[Our docs show](https://docs.getdbt.com/docs/build/snapshots)

two fields in the existing row should be updated when the `updated_at` timestamp is changed signifying a change of some value, the `dbt_valid_to` and the `dbt_updated_at`

![image](https://github.com/dbt-labs/dbt-core/assets/30663534/77a6c1db-3336-4abe-9a80-a8e398e16237)

Looks like only one update is happening and the `dbt_updated_at` does not get updated.

![Screen Shot 2023-06-14 at 2 06 07 PM](https://github.com/dbt-labs/dbt-core/assets/30663534/dd03040c-c348-45db-aae8-fec79da3a97e)

### Expected Behavior

According to the docs, the older row should have two fields updated:
`dbt_valid_to`
`dbt_updated_at`

### Steps To Reproduce

- create snapshot with timestamp check
- add record `1 as id, '2023-01-01' as updated_at`
- run snapshot
- modify record `1 as id, '2023-01-02' as updated_at`
- run snapshot
- check the records in the output and see if `dbt_updated_at` has been modified in the original row

### Relevant log output

_No response_

### Environment

```markdown
- OS:
- Python:
- dbt: tested 1.1 and 1.4
```

### Which database adapter are you using with dbt?

_No response_

### Additional Context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.