{% macro get_table_qualified_name(model_name) %}
    {% if execute %}
        {% set models = graph.nodes.values() %}
        {% set model = (models | selectattr('name', 'equalto', model_name) | list).pop() %}
        {% if model is not none %}
            {% set table_qualified_name = model.schema ~ '.' ~ model.alias if model.alias is not none and model.alias != '' else model.schema ~ '.' ~ model.name %}
            {{ return(table_qualified_name) }}
        {% else %}
            {{ exceptions.raise("Model not found: " ~ model_name) }}
        {% endif %}
    {% endif %}
{% endmacro %}