-
Notifications
You must be signed in to change notification settings - Fork 178
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
Support using different dbt paths for DAG rendering and dbt execution #568
Comments
Discussed in the #airflow-dbt channel: |
This ticket was brought up in a new thread in the #airflow-dbt slack channel: |
I'm happy to start working on this issue; however before i do so, i'd like to discuss some options i believe we have. Since a majority of the work required to implement this was included in #605, the main changes that need to be made here is the generation of new user-configurable fields. At the moment, i have the following list of ideas that i think would be worthy of discussion: 1 - add a new field to ProjectConfig, alongside dbt_project_path called dbt_execution_path My current thinking is that 2 would be the best approach, and it would get us in a position where #597 could be implemented in the future without being too breaking, as this would, in theory, have a similar interface. It would mean that #597's scope would be reduced to a ProjectConfig deprecation of some sort as opposed to a full interface change. We could also add a deprecation notice for the ProjectConfig field in favor of these two new fields, though it would likely be out of scope for this PR - up for debate though. If we can get some agreeance on the direction and scope (or indeed another option other than the ones specified above), i could start working on this immediately Appreciate any feedback / discussion. |
Hey @MrBones757 , I agree with you on approach (2). This way, we are backward compatible while teaching users how we'd like them to do things from now onwards. Go for it! 🚀 |
… Rendering and Execution (#634) This MR finishes the work that was started in #605 to add full support for ProjectConfig.dbt_project_path = None, and implements #568. Within this PR, several things have been updated: 1 - Added project_path fields to RenderConfig and ExecutionConfig 2 - Simplified the consumption of RenderConfig in the dbtGraph class 3 - added option to configure different dbt executables for Rendering vs Execution. Closes: #568
… Rendering and Execution (#634) This MR finishes the work that was started in #605 to add full support for ProjectConfig.dbt_project_path = None, and implements #568. Within this PR, several things have been updated: 1 - Added project_path fields to RenderConfig and ExecutionConfig 2 - Simplified the consumption of RenderConfig in the dbtGraph class 3 - added option to configure different dbt executables for Rendering vs Execution. Closes: #568 (cherry picked from commit b64eb9a)
… Rendering and Execution (#634) This MR finishes the work that was started in #605 to add full support for ProjectConfig.dbt_project_path = None, and implements #568. Within this PR, several things have been updated: 1 - Added project_path fields to RenderConfig and ExecutionConfig 2 - Simplified the consumption of RenderConfig in the dbtGraph class 3 - added option to configure different dbt executables for Rendering vs Execution. Closes: #568 (cherry picked from commit b64eb9a)
… Rendering and Execution (astronomer#634) This MR finishes the work that was started in astronomer#605 to add full support for ProjectConfig.dbt_project_path = None, and implements astronomer#568. Within this PR, several things have been updated: 1 - Added project_path fields to RenderConfig and ExecutionConfig 2 - Simplified the consumption of RenderConfig in the dbtGraph class 3 - added option to configure different dbt executables for Rendering vs Execution. Closes: astronomer#568
… Rendering and Execution (astronomer#634) This MR finishes the work that was started in astronomer#605 to add full support for ProjectConfig.dbt_project_path = None, and implements astronomer#568. Within this PR, several things have been updated: 1 - Added project_path fields to RenderConfig and ExecutionConfig 2 - Simplified the consumption of RenderConfig in the dbtGraph class 3 - added option to configure different dbt executables for Rendering vs Execution. Closes: astronomer#568
… Rendering and Execution (#634) This MR finishes the work that was started in #605 to add full support for ProjectConfig.dbt_project_path = None, and implements #568. Within this PR, several things have been updated: 1 - Added project_path fields to RenderConfig and ExecutionConfig 2 - Simplified the consumption of RenderConfig in the dbtGraph class 3 - added option to configure different dbt executables for Rendering vs Execution. Closes: #568
… Rendering and Execution (#634) This MR finishes the work that was started in #605 to add full support for ProjectConfig.dbt_project_path = None, and implements #568. Within this PR, several things have been updated: 1 - Added project_path fields to RenderConfig and ExecutionConfig 2 - Simplified the consumption of RenderConfig in the dbtGraph class 3 - added option to configure different dbt executables for Rendering vs Execution. Closes: #568
Context
As of Cosmos 1.1.x, the argument project_dir (passed in the ProjectConfig constructor) is used for two purposes:
Although this makes sense for the
ExecutionMode.LOCAL
, it would make more sense to declare different paths when usingExecutionMode.DOCKER
andExecutionMode.KUBERNETES
.This was raised as an issue by @adityasharma1685 in the Apache Airflow #airflow-dbt Slack channel:
https://apache-airflow.slack.com/archives/C059CC42E9W/p1695930777905369
Proposal
Introduce two new configuration arguments to be passed in the constructor
RenderConfig(dbt_project_path="airflow-worker-dbt-project-path")
(optional, new)ExecutionConfig(dbt_project_path="where-dbt-is-executed")
(optional, new)To complement:
ProjectConfig(dbt_project_path="current-project-path-used-for-parsing-and-execution") (existing)
For the DAG generation (1), we could:
a. Use
RenderConfig.dbt_project_path
if defined, orb. Fallback to the existing config (backward compatible)
ProjectConfig.dbt_project_path
For dbt execution (2), we could:
a. Use
ExecutionConfig.dbt_project_path
if defined, orb. Fallback to the existing config (backward compatible)
ProjectConfig.dbt_project_path
Alternative
I'm still trying to figure out alternatives. Any ideas are very welcome!
It would probably not work to set project_dir (
astronomer-cosmos/cosmos/operators/base.py
Line 83 in 0123c3e
Acceptance criteria
ExecutionConfig
The text was updated successfully, but these errors were encountered: