File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 307307 ' No data found in "{{ model_relation.identifier }}"{{ where_suffix }}. Expected data to be updated before {{ formatted_sla_time }} {{ timezone }}.'
308308 when freshness_status = ' DATA_STALE'
309309 then
310- ' Data in "{{ model_relation.identifier }}" is stale. Last update was at '
311- || cast(max_timestamp as {{ elementary .edr_type_string () }})
312- || ' , which is before today. Expected fresh data before {{ formatted_sla_time }} {{ timezone }}.'
310+ {{
311+ elementary .edr_concat (
312+ [
313+ " 'Data in \" "
314+ ~ model_relation.identifier
315+ ~ " \" is stale. Last update was at '" ,
316+ " cast(max_timestamp as "
317+ ~ elementary .edr_type_string ()
318+ ~ " )" ,
319+ " ', which is before today. Expected fresh data before "
320+ ~ formatted_sla_time
321+ ~ " "
322+ ~ timezone
323+ ~ " .'" ,
324+ ]
325+ )
326+ }}
313327 else
314- ' Data in "{{ model_relation.identifier }}" is fresh, last update at '
315- || cast(max_timestamp as {{ elementary .edr_type_string () }})
316- || ' (before SLA deadline {{ formatted_sla_time }} {{ timezone }}).'
328+ {{
329+ elementary .edr_concat (
330+ [
331+ " 'Data in \" "
332+ ~ model_relation.identifier
333+ ~ " \" is fresh, last update at '" ,
334+ " cast(max_timestamp as "
335+ ~ elementary .edr_type_string ()
336+ ~ " )" ,
337+ " ' (before SLA deadline "
338+ ~ formatted_sla_time
339+ ~ " "
340+ ~ timezone
341+ ~ " ).'" ,
342+ ]
343+ )
344+ }}
317345 end as result_description
318346 from freshness_result
319347 )
Original file line number Diff line number Diff line change 44{#
55 Validate that a timezone string is a valid IANA timezone name.
66 Raises a clear error if invalid.
7+
8+ Note: dbt- fusion' s modules.pytz has known discrepancies with dbt-core' s
9+ pytz (see dbt- labs/ dbt- fusion# 143). We skip validation in fusion and
10+ fall back to zoneinfo- based validation when pytz is unavailable.
711# }
812{% macro validate_timezone(timezone) %}
9- {% set pytz = modules .pytz %}
10-
1113 {% if not timezone %}
1214 {{
1315 exceptions .raise_compiler_error (
1618 }}
1719 {% endif %}
1820
21+ {# Skip pytz validation in dbt-fusion due to known discrepancies #}
22+ {% if elementary .is_dbt_fusion () %} {% do return(none) %} {% endif %}
23+
24+ {% set pytz = modules .pytz %}
25+
1926 {# Check if timezone is in pytz's list of all timezones #}
2027 {% if timezone not in pytz .all_timezones %}
2128 {{
You can’t perform that action at this time.
0 commit comments