{# Spec 155 - unused destination table section, rendered on the opportunity detail page when the anchor's opportunity_type is "unused_destination_table". Separate from the Materialization section because the question it answers is different: "should this table exist at all?" rather than "how should it be persisted?". Inputs from the route: ``unused_candidates`` - list of evidence_snapshot dicts (one per orphan opportunity on this affected_table); each carries the standard reasoning block + caveats shape. Renders nothing when the list is empty, so the partial can be included unconditionally from detail.html. #} {% if unused_candidates %} {% from "components/_section_title.html" import section_title %}
{{ section_title( "Unused destination table", description="This table is rebuilt regularly but no other query reads from it inside the scan window. Review whether it's still needed.", aside=((unused_candidates | length) ~ (' candidate' if (unused_candidates | length) == 1 else ' candidates')) ) }}
{% for cand in unused_candidates %}
flagged: unused audit-detected {% if cand.dbt_node_id %} {{ cand.dbt_node_id }} {% endif %}
{# Reasoning block. Same shape and macro signature as the materialization partial - the user reads the same five labelled lines on both surfaces, just with different content. We import the macro from the sibling partial. #} {% from "opportunities/_materialization.html" import reasoning_block %} {{ reasoning_block(cand.reasoning, caveats=cand.caveats) }}
{% endfor %}
{% endif %}