diff --git a/integration_tests/models/staging/source_1/source.yml b/integration_tests/models/staging/source_1/source.yml index 35f5eb02..dda51887 100644 --- a/integration_tests/models/staging/source_1/source.yml +++ b/integration_tests/models/staging/source_1/source.yml @@ -16,8 +16,7 @@ sources: - name: table_2 - name: table_4 - name: table_5 - freshness: # default freshness - warn_after: null + freshness: null - name: raw_table_5 identifier: table_5 diff --git a/macros/unpack/get_source_values.sql b/macros/unpack/get_source_values.sql index 7c026dd3..00b5f5cc 100644 --- a/macros/unpack/get_source_values.sql +++ b/macros/unpack/get_source_values.sql @@ -24,8 +24,8 @@ "cast(" ~ dbt_project_evaluator.is_not_empty_string(node.description) | trim ~ " as boolean)", "cast(" ~ node.config.enabled ~ " as boolean)", wrap_string_with_quotes(node.loaded_at_field | replace("'", "_")), - "cast(" ~ (dbt_project_evaluator.is_not_empty_string(node.freshness.warn_after.count) - or dbt_project_evaluator.is_not_empty_string(node.freshness.error_after.count)) | trim ~ " as boolean)", + "cast(" ~ ((node.freshness != None) and (dbt_project_evaluator.is_not_empty_string(node.freshness.warn_after.count) + or dbt_project_evaluator.is_not_empty_string(node.freshness.error_after.count))) | trim ~ " as boolean)", wrap_string_with_quotes(node.database), wrap_string_with_quotes(node.schema), wrap_string_with_quotes(node.package_name),