-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test parsing context: package + macro deps + dispatch, oh my #3362
Comments
After discussing with @gshank, we've realized:
{% macro _get_utils_namespaces() %}
{% set override_namespaces = var('dbt_utils_dispatch_list', []) %}
{% do return(override_namespaces + ['dbt_utils']) %}
{% endmacro %}
{%- macro type_string() -%}
{{ return(adapter.dispatch('type_string', packages = dbt_utils._get_utils_namespaces())()) }}
{%- endmacro -%} For now, we're thinking about ways to call/render the |
Follow-on from #3345 (I know, I hoped we were done with this one too!)
For better and for worse (definitely better!),
dbt-utils
does a lot of things with macro nesting and dispatching within custom schema test definitions. So, it's pretty good surface area for testing this functionality. This is on me for not testing #3345 againstdbt-utils
before approving #3345.The problem seems to be when a package macro's dispatched implementation calls, in turn, another dispatched package macro. The second macro isn't included in the test parsing context. Currently, we're seeing this issue with
dbt_utils.test_recency
, the default implementation of which in turn calls thedbt_utils.current_timestamp
macro:I've opened a draft PR (#3363) that adds a reproduction case to
008_schema_tests_test
. I'm hopeful that this is as simple as altering the logic we've already put in place to recurse throughdepends_on.macros
and add to the test parsing context.Once we have a fix for that, we'll also need to cherry-pick it (and the fix from #3345) onto
0.19.latest
for inclusion in v0.19.2-rc2.The text was updated successfully, but these errors were encountered: