-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for loading manifest from cloud store using Airflow Objec…
…t Store (#1109) ## Summary This PR introduces the capability to load `manifest.json` files from various cloud storage services using Airflow's Object Store integration. The supported cloud storages include AWS S3, Google Cloud Storage (GCS), and Azure Blob Storage. The feature allows seamless integration with remote paths, providing enhanced flexibility and scalability for managing DBT projects. ### Key Changes 1. Parameters in DbtDag and DbtTaskGroup: `manifest_path`: Accepts both local paths and remote URLs (e.g., S3, GCS, Azure Blob Storage). `manifest_conn_id`: (Optional) An Airflow connection ID for accessing the remote path. 2. Automatic Detection of Storage Type: The system automatically identifies the storage service based on the scheme of the URL provided (e.g., s3://, gs://, abfs://) by integrating with Airflow Object Store 3. If a `manifest_conn_id` is provided, it is used to fetch the necessary credentials. 4. If no `manifest_conn_id` is provided, the default connection ID for the identified scheme is used. ### Validation and Error Handling 1. Validates the existence of the `manifest.json` file when a path is specified. 2. Raises appropriate errors if a remote `manifest_path` is given but the required min Airflow version 2.8(Object Store feature) support is not available. ### Backward Compatibility Ensures compatibility with existing workflows that use local paths for the manifest.json. ### How to Use 1. Local Path: ``` DbtDag( project_config=ProjectConfig( manifest_path="/path/to/local/manifest.json", ), ... ) ``` 2. Remote Path (e.g., S3): ``` DbtDag( project_config=ProjectConfig( manifest_path="s3://bucket/path/to/manifest.json", manifest_conn_id="aws_s3_conn", ), ... ) ``` 3. Remote Path without Explicit Connection ID: ``` DbtDag( project_config=ProjectConfig( manifest_path="gs://bucket/path/to/manifest.json", # No manifest_conn_id provided, will use default Airflow GCS connection `google_cloud_default` ), ... ) ``` ### Additional Notes 1. Ensure that the required Airflow version (2.8 or later) is used to take advantage of the Object Store features. 2. Review the updated documentation for detailed usage instructions and examples. ### Testing 1. Added unit tests to cover various scenarios including local paths, remote paths with and without manifest_conn_id. 2. Verified integration with different cloud storage services (AWS S3, GCS, Azure Blob Storage). 3. Ensured backward compatibility with existing local path workflows. ## Related Issue(s) closes: #448 ## Breaking Change? No. ## Checklist - [x] I have made corresponding changes to the documentation (if required) - [x] I have added tests that prove my fix is effective or that my feature works --------- Co-authored-by: Tatiana Al-Chueyr <tatiana.alchueyr@gmail.com>
- Loading branch information
1 parent
89a8034
commit b8a14a3
Showing
13 changed files
with
264 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.