{# Vendored from opportunities/_table.html. Same wrapper, same ui-table-head-row + ui-table-row grammar, same click-to-sort header markup, same ui-signal-chip + ui-legend-dot chip styles. Deltas vs the opportunities table: - column set swaps "Issue" → "Reason", "Query Cost" → "Slot Wasted", "Last Detected" → "Last Failed", and drops "Partition / Cluster" (irrelevant on failures); - row click target → /failures/{hash_key}; - empty-state copy mirrors opportunities. #}
{% if rows and rows | length > 0 %}
{% set fail_cols = [ ('dataset', 'Dataset', 'left'), ('table', 'Object', 'left'), ('author', 'Author', 'left'), ('reason', 'Reason', 'left'), ('workload', 'Workload', 'left'), ('slot', 'Slot Wasted', 'right'), ] %} {% if not local_runtime_mode %} {% set fail_cols = fail_cols + [('occurrence', 'Occurrences', 'right')] %} {% endif %} {% set fail_cols = fail_cols + [('age', 'Last Failed', 'right')] %} {% set fail_cols = fail_cols + [('suggestions', 'Suggestions', 'center')] %} {% for col_key, col_label, col_align in fail_cols %} {% set _next_dir = 'asc' if (signals.sort == col_key and signals.direction == 'desc') else 'desc' %} {% set _qs = pagination.query_string_without_sort_or_page %} {% set _sep = '&' if _qs else '' %} {% set _href = '?' ~ _qs ~ _sep ~ 'sort=' ~ col_key ~ '&direction=' ~ _next_dir %} {% endfor %} {% for row in rows %} {% if not local_runtime_mode %} {% endif %} {% endfor %}
{% if col_key == 'slot' %}
Sum of total_slot_ms across every failed execution of this query body. {{ col_label }}{% if signals.sort == col_key %} {{ '↓' if signals.direction == 'desc' else '↑' }}{% endif %}
{% else %} {{ col_label }}{% if signals.sort == col_key %} {{ '↓' if signals.direction == 'desc' else '↑' }}{% endif %} {% endif %}
{{ row.affected_dataset }} {{ row.affected_object }} {% if row.author_email %} {{ row.author_email }} {% else %} {% endif %} {% if row.last_error_reason %} {{ row.last_error_reason }} {% else %} {% endif %} {% if row.query_workload_kind == 'build' %} Build {% elif row.query_workload_kind == 'consumption' %} Consumption {% elif local_runtime_mode %} Unclassified {% else %} Query {% endif %} {{ row.slot_wasted_human }} {{ row.occurrence_count }} {{ row.last_detected_at.strftime("%d/%m/%Y") if row.last_detected_at else "—" }} {% set _sugg = row.table_suggestion_count or 0 %} {% if _sugg > 0 %} {{ _sugg }} suggested {% endif %}
{% include "failures/_pagination.html" %} {% else %}

No failures match your filters

{% endif %}