Freshness deprecation error

The problem I’m having

Null freshness tests throwing error when migrating them to the config block as recommended by documentation

The context of why I’m trying to do this

In the project there are freshness checks for the entire source that needs to be ignored for some models that are not expected to get updated frequently (e.g look up values)

version: 2

sources:
  - name: source
    config:
      freshness:
        warn_after:
          count: 1
          period: day
        error_after:
          count: 7
          period: day
      loaded_at_field: "record_timestamp"
    tables:
      - name: source_a
      - name: source_b
        config:
            freshness: null
      - name: source_c

This although still in the documentation and in current pull request on the dbt docs website repo
(Update examples by luna-bianca · Pull Request #7354 · dbt-labs/docs.getdbt.com) throws an error

dbt command failedArgument for dbt.artifacts.resources.v1.components.FreshnessThreshold.__mashumaro_from_dict__ method should be a dict instance

What I’ve already tried

I’ve looked at the issues and pull requests in the dbt docs github repo and found that the documentation still recommends this approach,

I’ve landed on the solution bellow, however I’ve found that this does not make dbt ignore the freshness checks for these sources, instead it marks them as stale

        config:
          freshness: {}

Is there something I’m missing or missunderstanding from the documentation?

Thank you in advance for your help!! :grinning_face:

I am facing the same problem here while trying to fix the deprecation warnings.
There are some automatic fixes available here but I can only access dbt from the browser due to company policies.
I also tried the approach below but I get the same error.

freshness: {
        warn_after: {
          count: 12,
          period: hour},
        error_after: {
          count: 24,
          period: hour}
      }

I’ve done some further research and it seems to be a bug, its already been flagged as an issue in the dbt core repo, ([Bug] new config.freshness throws error when explicitly set to null · Issue #11685 · dbt-labs/dbt-core)

The fix should be released with version 1.10 from my understanding of their epic?
[EPIC] 1.10 Deprecations + Improved Developer Experience · Issue #11335 · dbt-labs/dbt-core

I have a similar type of problem, however it does not apply only to when freshness is set to null, but any type of freshness configuration.

The problem I am having
Whenever I try to specify freshness as part of a config I get the following error when running the dbt source freshness command. Unhandled error while executing.

Can this be linked to our project running on Redshift?

I am unsure as to what can be causing this,

Can you upload an example of how you’re applying the freshness config?

Yes, sure, please see below.
Here it is on the schema level:

  - name: name
    database: db_name
    schema: schema_name
    config: 
      freshness:
        warn_after: {count: 24, period: hour}
      loaded_at_field: load_date

And on the model level:

- name: model_name
  config:
   freshness:
     error_after:
       count: 6
       period: hour
   loaded_at_field: load_date

It seems like you might be indenting the config incorrectly at the model level where the config property should be at the same level as name

Model configurations | dbt Developer Hub

I’m not sure if it just got missformated when you copied into the forum, if thats the case I can’t see any issue with it :thinking:

Yeah, this got missformatted..

You were close apparently the correct formatting is:

- name: model_name
  config:
    freshness:
      error_after:
        count: 6
        period: hour
  loaded_at_field: load_date