Skip to content

[Backport 1.9.latest] Backport #11698 to 1.9.latest #11703

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

Merged
merged 1 commit into from
May 30, 2025

Conversation

QMalcolm
Copy link
Contributor

When we backported #11628 to 1.9.latest via #11683 we backported a bug along with it. We fixed the bug in #11698, and thus we need to backport that fix (which this does)

…precedence (#11698)

* Handle explicit setting of null for source freshness config

* Abstract out the creation of the target config

This is useful because it makes that portion of code more re-usable/portable
and makes the work we are about to do easier.

* Fix bug in `merge_source_freshness` where empty freshness was preferenced over `None`

The issue was that during merging of freshnesses, an "empty freshness", one
where all values are `None`, was being preferenced over `None`. This was
problematic because an "empty freshness" indicates that a freshness was not
specified at that level. While `None` means that the freshness was _explicitly_
set to `None`. As such we should preference the thing that was specifically set.

* Properly get dbt_project defined freshness and don't merge with schema defined freshness

Previously we were only getting the "top level" freshness from the
dbt_project.yaml. This was ignoring freshness settings for the direct,
source, and table set in the dbt_project.yaml. Additionally, we were
merging the dbt_project.yaml freshness into the schema freshness. Long
term this merging would be desireably, however before we do that we need
to ensure freshness at diffrent levels within the dbt_project.yml get
properly merged (currently the different levels clobber each other). Fixing
that is a larger issue though. So for the time being, the schema defintion
of freshness will clobber any dbt_project.yml definition of freshness.

* Add changie doc

* Fix whitespace to make code quality happy

* Set the parsed source freshness to an empty FreshnessThreshold if None

This maintains backwards compatibility
@QMalcolm QMalcolm requested a review from a team as a code owner May 30, 2025 16:28
@cla-bot cla-bot bot added the cla:yes label May 30, 2025
Copy link

codecov bot commented May 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.06%. Comparing base (3b92f67) to head (239c934).
Report is 1 commits behind head on 1.9.latest.

Additional details and impacted files
@@              Coverage Diff               @@
##           1.9.latest   #11703      +/-   ##
==============================================
- Coverage       89.09%   89.06%   -0.04%     
==============================================
  Files             184      184              
  Lines           23935    23941       +6     
==============================================
- Hits            21326    21322       -4     
- Misses           2609     2619      +10     
Flag Coverage Δ
integration 86.37% <100.00%> (-0.13%) ⬇️
unit 62.20% <88.23%> (+0.03%) ⬆️

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

Components Coverage Δ
Unit Tests 62.20% <88.23%> (+0.03%) ⬆️
Integration Tests 86.37% <100.00%> (-0.13%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@QMalcolm QMalcolm merged commit e192609 into 1.9.latest May 30, 2025
58 of 59 checks passed
@QMalcolm QMalcolm deleted the backport-11698-to-1.9.latest-manual branch May 30, 2025 16:40
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.

2 participants