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
9.25k stars 1.53k forks source link

Warn if timestamp updated_at field uses incompatible timestamp #10352

Open gshank opened 1 week ago

gshank commented 1 week ago

resolves #10234

Problem

Snapshot tables use the 'get_snapshot_time' macro, which may be incompatible with the data type of the field specified as the 'updated_at' field, causing unexpected results.

Solution

Warn if the two sources of timestamp columns have different data types.

Checklist

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.74%. Comparing base (ca163c3) to head (871052c). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #10352 +/- ## ========================================== - Coverage 88.75% 88.74% -0.02% ========================================== Files 180 180 Lines 22486 22497 +11 ========================================== + Hits 19958 19964 +6 - Misses 2528 2533 +5 ``` | [Flag](https://app.codecov.io/gh/dbt-labs/dbt-core/pull/10352/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dbt-labs) | Coverage Δ | | |---|---|---| | [integration](https://app.codecov.io/gh/dbt-labs/dbt-core/pull/10352/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dbt-labs) | `86.00% <100.00%> (-0.02%)` | :arrow_down: | | [unit](https://app.codecov.io/gh/dbt-labs/dbt-core/pull/10352/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dbt-labs) | `62.19% <87.50%> (-0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dbt-labs#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.