diff --git a/dbt/clients/jinja.py b/dbt/clients/jinja.py index 9f85c553116..40cf1ae5950 100644 --- a/dbt/clients/jinja.py +++ b/dbt/clients/jinja.py @@ -246,7 +246,7 @@ def __call__(self, *args, **kwargs): def get_environment(node=None, capture_macros=False): args = { - 'extensions': [] + 'extensions': ['jinja2.ext.do'] } if capture_macros: diff --git a/test/unit/test_jinja.py b/test/unit/test_jinja.py new file mode 100644 index 00000000000..21abd573b5b --- /dev/null +++ b/test/unit/test_jinja.py @@ -0,0 +1,11 @@ +import unittest + +from dbt.clients.jinja import get_template + +class TestJinja(unittest.TestCase): + def test_do(self): + s = '{% set my_dict = {} %}\n{% do my_dict.update(a=1) %}' + + template = get_template(s, {}) + mod = template.make_module() + self.assertEqual(mod.my_dict, {'a': 1})