{# "Top Cost Drivers with Issues and Suggestions Found" — same `ui-table` style as governor_web/_cost_drivers_table.html, with a server-side click-to-sort engine: each header is an that flips direction if the column is already active. Filters to jobs with at least one issue or one suggestion finding so any flagged row shows up. #} {% set _sort = sort_by | default('spend') %} {% set _dir = sort_dir | default('desc') %} {# Macro: render a sortable column header. Toggling the active column flips direction; switching columns resets to desc. Always returns page=1 so users don't end up past the new tail. #} {% macro _sort_th(col, label, align="left", extra="") %} {% set is_active = (_sort == col) %} {% set next_dir = 'asc' if (is_active and _dir == 'desc') else 'desc' %} {% set arrow = '↓' if (is_active and _dir == 'desc') else ('↑' if is_active else '') %}
|
{{ j.destination_dataset }}
|
{{ j.destination_object }}
{% if j.statement_type %}
{{ j.statement_type }}
{% endif %}
|
{{ j.cost_usd | format_usd }}
{{ "%.1f" | format(j.cost_share_pct) }}%
|
{{ j.bytes_processed | format_bytes }} | {{ "%.1f" | format((j.slot_time_ms or 0) / 3600000) }} | {% if j.issue_count > 0 %} {{ j.issue_count }} {% else %} 0 {% endif %} | {% if j.suggestion_count > 0 %} {{ j.suggestion_count }} {% else %} 0 {% endif %} | {% if j.workload_kind == "build" %} build {% elif j.workload_kind == "consumption" %} consumption {% else %} other {% endif %} | {% if j.is_dbt_originated %} dbt {% else %} other {% endif %} | {% if j.creation_time %} {{ j.creation_time.strftime("%Y-%m-%d %H:%M") }} UTC {% else %} — {% endif %} |
No flagged jobs in the cached scan. Run the detection engine over more queries or relax the rule overrides.
{% endif %}