Fix: Set dbt execute variable for parse time and run time accordingly#5327
Fix: Set dbt execute variable for parse time and run time accordingly#5327themisvaltinos wants to merge 1 commit intomainfrom
Conversation
| { | ||
| "adapter": adapter, | ||
| "execute": True, | ||
| "execute": isinstance(adapter, RuntimeAdapter), |
There was a problem hiding this comment.
No, we should not do this. execute is set unconditionally to True for a reason. Since we used the rendered query for change detection and categorization we want to follow the execution path during rendering. If we happen to encounter the adapter call we fail and return None which indicates that the query cannot be rendered and categorized.
There was a problem hiding this comment.
Since we used the rendered query for change detection and categorization we want to follow the execution path during rendering. If we happen to encounter the adapter call we fail and return None which indicates that the query cannot be rendered and categorized.
I see was wondering about this, thanks that makes sense. and I guess now that we can fail and still proceed later to runtime this can't lead to any issues
izeigerman
left a comment
There was a problem hiding this comment.
Why isn't graph available at load time?
I was mirroring dbt, but since we already have the manifest loaded you're right it will be available at "our parse time", it's a different distinction. I will proceed to add it |
This update sets the dbt variable
executeto False during parse-time and true for run time. Dbt models and macros have conditional logic which is guarded with this flag for runtime execution:These jinja expressions might depend on the data warehouse or to objects (like
graph) not available at parse time, so theexecuteensure these only should run at the runtime stage.dbt docs: https://docs.getdbt.com/reference/dbt-jinja-functions/execute