Jinja macros
What are Macros?
Scope of Macros
Create and run macros
{% macro macro_name %}
<!-- Macro code goes here -->
{% endmacro %}{% macro rm_null(test_list) %}
{{ [item for item in test_list if item] }}
{% endmacro %}
{% set new_list = [1, 2, 4, null, 5, null] %}
{{ rm_null(new_list) }}Default values in macros
Last updated
Was this helpful?
