Stability of the Jinja render function

Hello,

I’m one of the contributors to the dbt-unit-testing package, and I would like to ask a question to the dbt community.

We are using the render function in our Jinja code to generate the final compiled SQL of a model.

Therefore, my question is, do you think it’s safe to use the render function? Is it likely to change or be removed in the future?

I don’t speak for the dbt Core team directly, but I wouldn’t expect this to be removed in a minor version of dbt. If it were to be slated for removal in something like dbt v2.0.0 then there would be significant forewarning.

So I expect you should be OK, but don’t hold me to that :sweat_smile:

Hi @joellabes, thank you so much for your response. I do believe you’re correct; I would just like to hear it from the dbt folks. :slight_smile:

Thanks for reaching out @psousa50. I’m one of the maintainers for dbt-core, and I can answer your question.

Here’s the source code for the render jinja context member:

And here’s a little bit of explanation about get_rendered.

While I’m not aware of us advertising render as a public interface, it’s extremely unlikely to change anytime soon. So you should be safe to use it within the dbt-unit-testing package.

Hope this helps!

Side note: @joellabes is dbt folk, he just wanted to be careful about making promises since this is deep within the internals.

Hi @doug.beatty, thank you so much for your response, it was really helpful! :slightly_smiling_face:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.