Files
mars-elt/dbt/macros/common/get_child_models.sql
Grzegorz Michalski 2c225d68ac init
2026-03-02 09:47:35 +01:00

15 lines
466 B
SQL

{% macro get_child_models(model_name) %}
{% if execute %}
{% set graph = graph.nodes %}
{% set children = [] %}
{% for node, details in graph.items() %}
{% for item in details.depends_on.nodes %}
{% if model_name == item.split('.')[2] %}
{% do children.append(node.split('.')[2]) %}
{% break %}
{% endif %}
{% endfor %}
{% endfor %}
{{ return(children) }}
{% endif %}
{% endmacro %}