list_dynamic_ref_constraint_candidates()

Return sorted leaf cells missing dynamic-ref constraint entries.

Usage

Source

list_dynamic_ref_constraint_candidates(
    workbook,
    targets,
    *,
    dynamic_refs=None,
    max_depth=50,
    max_range_cells=5000,
    type_analysis_cache=None
)

These are leaf cell addresses that feed dynamic-ref arguments (OFFSET/INDIRECT/INDEX) but have no entry in dynamic_refs.cell_type_env.

Unlike create_dependency_graph, this function does not raise DynamicRefError when constraints are missing. Instead it collects all missing leaf addresses in a single pass and returns them sorted.

When dynamic_refs is None the function treats it as an empty constraint environment: all leaf cells that feed dynamic-ref arguments are returned as candidates.

Completeness caveat: Cells reachable only through unresolvable dynamic refs will not be visited, so their constraint candidates won’t appear in the output. A second call after adding the first batch of constraints will quickly find any remaining missing entries.