-
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
[Bug] Full refresh model config not respected when coming from a macro and partial parsing is used #9789
Comments
Thanks for reaching out @rlh1994 ! I didn't read through your example carefully yet. But in the meantime, did try out including the |
@dbeatty10 I'd just been exploring that before you commented, but yes that does force the correct full refresh behaviour, so it is related to the partial parsing! |
@rlh1994 Glad that adding Here's a couple other debugging steps I did on this one:
Examining the manifestI like using In this case, you can examine the actual value of cat target/manifest.json| jq '.nodes."model.my_project.my_model".config.full_refresh' Logging in the macro depending if
|
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 comment on the issue or else it will be closed in 7 days. |
Is this a new bug in dbt-core?
Current Behavior
The situation is when I use a macro to define if a model should full refresh or not, despite the macro returning
none
the model still sometimes full refreshes without using the--full-refresh
flag. This seems to be related to partial parsing as when this is disabled, or there is something that forces a full parse, this does not occur.Expected Behavior
The incremental model to respect the macro value/full refresh flag.
Steps To Reproduce
my_macro.sql
:my_model.sql
with the following content:SELECT 1
, and if you query the data you will see only 1 record - as expected so far.SELECT 1
, and find that only a single record exists each time. You can also check the target run code and see it's using the create instead of an insert.dbt run --no-partial-parse
and it will trigger aninsert
correctly.Weirdly, the flag is correctly shown as
False
in the log, the return value is shown asNone
, so it's not clear why a full refresh is taking place.Changing something in the model or the macro (possibly also the project file, didn't test that) seems to then kick it to correct itself and from then onwards it correctly respects the flag. Basically anything that means you can't do partial parsing anymore.
Relevant log output
Environment
Which database adapter are you using with dbt?
postgres
Additional Context
No response
The text was updated successfully, but these errors were encountered: