You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey there, I have been working on an Airflow module to enhance the functionality of the dbt cloud provider, I'd like to propose these changes as an enhancement to the dbt Cloud provider to support full lifecycle management of dbt Cloud jobs directly from Airflow. Currently, the provider only supports Triggering, Listing, and Monitoring existing jobs or with Sensors. The proposed enhancement would add capabilities to create, update, and delete dbt Cloud jobs, enabling complete workflow ownership from Airflow.
Does this sound like a good project to enhance the features of the current provider?
We are currently using version 2.9.2 of airflow, and I am curious if you allow checking out and patching old versions/tags. If this is accepted I can happily do this work, it would be my first attempt at contributing here.
As of Airflow 2.9.2 through to 4.4.0, the dbt Cloud provider offers the following functionality through the dbt cloud v2 api:
Listing jobs
Triggering jobs
Monitoring job execution status with Sensors
Retrieving job artifacts post run
However, it lacks the ability to:
Create jobs
Update job configurations
Delete jobs that are no longer needed
Perform comprehensive job management using the above concepts and use Airflow as a mastering tool for dbt cloud jobs.
This limitation forces users to manually create and configure dbt Cloud jobs through the UI or use separate scripts with the dbt Cloud API, breaking the ownership between other tools and Airflow to orchestrate jobs.
Proposed Solution
Extend the dbt Cloud provider with new operators and hook methods that cover the full job management lifecycle:
Enhanced Hook Functionality
Extend DbtCloudHook with new methods to enable this:
create_job: Creates a new job with specified payload
update_job: Updates an existing job with new payload
destroy_job: Deletes a job by ID
Introduce New Operators
DbtCloudCreateJobOperator: Create jobs
DbtCloudUpdateJobOperator: Update jobs
DbtCloudDestroyJobOperator: Delete jobs
DbtCloudJobManagementOperator: A higher-level operator that can create, update or ensure a job exists with the right configuration
for 4. a logical pattern can be established (i have done something similar in my module):
Step 1: Lists existing jobs with the specified name and finds their ids
Step 2: Creates a job if it doesn't exist (no ids are returned)
Step 3: Updates the job if it exists but config/payload has changed
Step 4: Destroys duplicate jobs if multiple exist with the same name (keeping the lowest job by id)
API Integration Details
The dbt Cloud API v2 provides endpoints for managing jobs:
POST /api/v2/accounts/{account_id}/jobs/: Create job
POST /api/v2/accounts/{account_id}/jobs/{id}/: Update job
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey there, I have been working on an Airflow module to enhance the functionality of the dbt cloud provider, I'd like to propose these changes as an enhancement to the dbt Cloud provider to support full lifecycle management of dbt Cloud jobs directly from Airflow. Currently, the provider only supports Triggering, Listing, and Monitoring existing jobs or with Sensors. The proposed enhancement would add capabilities to create, update, and delete dbt Cloud jobs, enabling complete workflow ownership from Airflow.
Does this sound like a good project to enhance the features of the current provider?
We are currently using version 2.9.2 of airflow, and I am curious if you allow checking out and patching old versions/tags. If this is accepted I can happily do this work, it would be my first attempt at contributing here.
Details: dbt Cloud Provider - Job Management Enhancement Proposal
Current Limitations
As of Airflow 2.9.2 through to 4.4.0, the dbt Cloud provider offers the following functionality through the dbt cloud v2 api:
However, it lacks the ability to:
This limitation forces users to manually create and configure dbt Cloud jobs through the UI or use separate scripts with the dbt Cloud API, breaking the ownership between other tools and Airflow to orchestrate jobs.
Proposed Solution
Extend the dbt Cloud provider with new operators and hook methods that cover the full job management lifecycle:
Enhanced Hook Functionality
Extend
DbtCloudHook
with new methods to enable this:create_job
: Creates a new job with specified payloadupdate_job
: Updates an existing job with new payloaddestroy_job
: Deletes a job by IDIntroduce New Operators
DbtCloudCreateJobOperator
: Create jobsDbtCloudUpdateJobOperator
: Update jobsDbtCloudDestroyJobOperator
: Delete jobsDbtCloudJobManagementOperator
: A higher-level operator that can create, update or ensure a job exists with the right configurationfor 4. a logical pattern can be established (i have done something similar in my module):
API Integration Details
The dbt Cloud API v2 provides endpoints for managing jobs:
POST /api/v2/accounts/{account_id}/jobs/
: Create jobPOST /api/v2/accounts/{account_id}/jobs/{id}/
: Update jobDELETE /api/v2/accounts/{account_id}/jobs/{id}/
: Delete jobTesting Strategy
Unit Tests
Integration Tests
Backwards Compatibility
All new functionality will be added in a backward-compatible way:
_run_and_get_response
Beta Was this translation helpful? Give feedback.
All reactions