prefect
prefect copied to clipboard
prefect-dbt: from_file method for TargetConfigs
First check
- [X] I added a descriptive title to this issue.
- [X] I used the GitHub search to find a similar request and didn't find it.
- [X] I searched the Prefect documentation for this feature.
Prefect Version
2.x
Describe the current behavior
Currently, you have to define a TargetConfigs block with Database/Data Warehouse configurations manually in python code or in the Prefect UI, which can then get passed to the DbtCliProfile to save the credentials. This usually means a lot of copying and pasting from the dbt profiles.yml or elsewhere.
Describe the proposed behavior
Add a from_file method to the TargetConfigs block to automatically populate the credentials and config into a new instance of a TargetConfigs block given an existing dbt profiles.yml file.
Example Use
target_configs = TargetConfigs.from_file(file_path="/path/to/profileyaml/.dbt/profile.yml")
dbt_cli_profile = DbtCliProfile(
name="jaffle_shop",
target="dev",
target_configs=target_configs,
)
Additional context
No response