-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[CT-170] [Bug] Changes to a nested macro are not recompiled #4692
Comments
We statically extract the macro calls to fill in the depends_on. I suspect that the code that does the extraction does not handle this case. I will investigate . |
It looks like the 'set_sql_header' is probably not actually executed at parse time, which would be the way that that nested macro would be found and added to the macro depends_on. @jtcohen6 Could you advise? |
@gshank I agree with your appraisal. The way dbt-core/core/dbt/include/global_project/macros/materializations/configs.sql Lines 1 to 3 in c112050
I think, because Separate from this particular issue, but — macros within |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue, or it will be closed in 7 days. |
Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest; add a comment to notify the maintainers. |
Is there an existing issue for this?
Current Behavior
In my model I have a call to a custom macro nested within a call to
set_sql_header
:custom_macro
is defined in another file. When I make changes tomy_custom_macro
they are not picked up when I re-compile my model - i.e. when I inspect the compiled SQL I see the output of the macro in its old state.If, instead of using
set_sql_header
, I inline its functionality into my model directly, the issue goes away. Changes to the custom macro are picked up when I recompile my model:I'm not sure if relevant, but I noticed that in
target/manifest.json
when I useset_sql_header
thenmy_custom_macro
does not appear in the list of macros that my model depends on (i.e. underdepends_on.macros
). When I switch to usingconfig.set('sql_header', header_sql)
directly thenmy_custom_macro
does appear in that list of macros.Expected Behavior
When I have a model with a call to a custom macro nested within a call to
set_sql_header
:and I make changes to
my_custom_macro
, I'd expect those changes to be reflected when I re-compile my model.Steps To Reproduce
my_model
and a custom macromy_custom_macro
in a separate file.my_model
, nest a call tomy_custom_macro
withinset_sql_header
:my_model
:my_model
my_custom_macro
my_model
my_model
and see it has not changedRelevant log output
No response
Environment
What database are you using dbt with?
bigquery
Additional Context
No response
The text was updated successfully, but these errors were encountered: