-
Notifications
You must be signed in to change notification settings - Fork 128
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
Add Source Freshness Results #437
base: main
Are you sure you want to change the base?
Add Source Freshness Results #437
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @dpguthrie - need to add some logic to handle cases when warn_after
or error_after
configs are not set.
'{{ source.node.name }}', {# name #} | ||
'{{ source.node.source_name }}', {# source_name #} | ||
'{{ source.node.loaded_at_field }}', {# loaded_at_field #} | ||
{{ source.node.freshness.warn_after.count }}, {# warn_after_count #} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{ source.node.freshness.warn_after.count }}, {# warn_after_count #} | |
{{ 'null' if source.node.freshness.warn_after.count is none else source.node.freshness.warn_after.count }} |
Was throwing an error when warn after not provided
'{{ source.node.source_name }}', {# source_name #} | ||
'{{ source.node.loaded_at_field }}', {# loaded_at_field #} | ||
{{ source.node.freshness.warn_after.count }}, {# warn_after_count #} | ||
'{{ source.node.freshness.warn_after.period }}', {# warn_after_period #} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'{{ source.node.freshness.warn_after.period }}', {# warn_after_period #} | |
{% if source.node.freshness.warn_after.period is none %} null {% else %} '{{ source.node.freshness.warn_after.period }}' {% endif %}, {# warn_after_period #} |
Handle None values
'{{ source.node.loaded_at_field }}', {# loaded_at_field #} | ||
{{ source.node.freshness.warn_after.count }}, {# warn_after_count #} | ||
'{{ source.node.freshness.warn_after.period }}', {# warn_after_period #} | ||
{{ source.node.freshness.error_after.count }}, {# error_after_count #} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{ source.node.freshness.error_after.count }}, {# error_after_count #} | |
{{ 'null' if source.node.freshness.error_after.count is none else source.node.freshness.error_after.count }}, {# error_after_count #} |
Handle None values
{{ source.node.freshness.warn_after.count }}, {# warn_after_count #} | ||
'{{ source.node.freshness.warn_after.period }}', {# warn_after_period #} | ||
{{ source.node.freshness.error_after.count }}, {# error_after_count #} | ||
'{{ source.node.freshness.error_after.period }}', {# error_after_period #} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'{{ source.node.freshness.error_after.period }}', {# error_after_period #} | |
{% if source.node.freshness.error_after.period is none %} null {% else %} '{{ source.node.freshness.error_after.period }}' {% endif %}, {# error_after_period #} |
Handle None value
Overview
This PR adds source freshness executions to the package. This was recently added into dbt-core and now if the user opts into this behavior (adding a specific flag in their dbt_project.yml file), the
Results
object will be populated with SourceFreshnessResults. The behavior is very similar to all of the other_executions
tables/models.Update type - breaking / non-breaking
What does this solve?
#166
Outstanding questions
The schema is slightly different than all of the other
_executions
tables. Happy to change that, it just seemed that 1) some of the info wasn't relevant and 2) there's additional info we need to capture.What databases have you tested with?