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

Enable setting datetime value for dbt_valid_to when the record is current #10780

Merged
merged 12 commits into from
Oct 10, 2024

Conversation

gshank
Copy link
Contributor

@gshank gshank commented Sep 25, 2024

Resolves #10187

Problem

Currently we use a null to indicate that a snapshot record is current. Users would like to use some arbitrary future date to indicate current instead, because it makes some SQL easier.

Solution

Add a new attribute "dbt_valid_to_current", and implement changes in adapters to use it.

Checklist

  • I have read the contributing guide and understand what's expected of me.
  • I have run this code in development, and it appears to resolve the stated issue.
  • This PR includes tests, or tests are not required or relevant for this PR.
  • This PR has no interface changes (e.g., macros, CLI, logs, JSON artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX.
  • This PR includes type annotations for new and modified functions.

@gshank gshank requested a review from a team as a code owner September 25, 2024 16:15
@cla-bot cla-bot bot added the cla:yes label Sep 25, 2024
@gshank gshank closed this Sep 25, 2024
@gshank gshank reopened this Sep 25, 2024
Copy link

codecov bot commented Sep 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.18%. Comparing base (f6cdacc) to head (5fc8a19).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10780      +/-   ##
==========================================
- Coverage   89.20%   89.18%   -0.03%     
==========================================
  Files         183      183              
  Lines       23419    23426       +7     
==========================================
+ Hits        20892    20893       +1     
- Misses       2527     2533       +6     
Flag Coverage Δ
integration 86.50% <100.00%> (-0.01%) ⬇️
unit 62.11% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Unit Tests 62.11% <100.00%> (+<0.01%) ⬆️
Integration Tests 86.50% <100.00%> (-0.01%) ⬇️

@gshank gshank requested a review from a team as a code owner September 25, 2024 18:10
@gshank gshank requested review from eddowh and removed request for a team September 25, 2024 18:10
@peterallenwebb
Copy link
Contributor

Reminder, we need to unpin the dependency branches before merge. Otherwise this looks good.

@gshank gshank merged commit c7d8693 into main Oct 10, 2024
60 of 62 checks passed
@gshank gshank deleted the snapshot_dbt_valid_to_current branch October 10, 2024 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow custom date for dbt_valid_to in snapshots
3 participants