-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support user-supplied profiles (#390)
## Description <!-- Add a brief but complete description of the change. --> This PR extends the `ProfileConfig` interface to support two modes: 1. the profile mapping, which takes an Airflow connection and translates it to a dbt profile 2. a user-supplied profile file When using a profile mapping, you can do one of the following: 1. Use the AutomaticProfileMapping class to auto-select a profile mapping ```python ProfileConfig( profile_name="default", target_name="dev", profile_mapping=get_automatic_profile_mapping( conn_id="airflow_db", args={"schema": "public"}, ), ) ``` 2. Specify a specific profile mapping ```python ProfileConfig( profile_name="default", target_name="dev", profile_=PostgresUserPasswordProfileMapping( conn_id="airflow_db", profile_args={"schema": "public"}, ), ) ``` When using your own profile, you can supply the `path_to_profiles_yml`: ```python ProfileConfig( profile_name="default", target_name="dev", path_to_profiles_yml=DBT_ROOT_PATH / "jaffle_shop" / "profiles.yml", ) ``` ## Related Issue(s) <!-- If this PR closes an issue, you can use a keyword to auto-close. --> <!-- i.e. "closes #0000" --> closes #336 closes #269 ## Breaking Change? <!-- If this introduces a breaking change, specify that here. --> This changes the `ProfileConfig` class, which isn't yet user-facing. ## Checklist - [ ] 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: Harel Shein <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Harel Shein <[email protected]>
- Loading branch information
1 parent
e1ff962
commit 3185e22
Showing
36 changed files
with
808 additions
and
522 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
Oops, something went wrong.