Skip to main content

prefect_dbt.cli.credentials

Module containing credentials for interacting with dbt CLI

Functions

target_configs_discriminator

Discriminator function for target configs. Returns the block type slug.

Classes

DbtCliProfile

Profile for use across dbt CLI tasks and flows. Attributes:
  • name: Profile name used for populating profiles.yml.
  • target: The default target your dbt project will use.
  • target_configs: Target configs contain credentials and settings, specific to the warehouse you’re connecting to. To find valid keys, head to the Available adapters page and click the desired adapter’s “Profile Setup” hyperlink.
  • global_configs: Global configs control things like the visual output of logs, the manner in which dbt parses your project, and what to do when dbt finds a version mismatch or a failing model. Valid keys can be found here.
Examples: Load stored dbt CLI profile:
Get a dbt Snowflake profile from DbtCliProfile by using SnowflakeTargetConfigs:
Get a dbt Redshift profile from DbtCliProfile by using generic TargetConfigs:
Methods:

get_profile

Returns the dbt profile, likely used for writing to profiles.yml. Returns:
  • A JSON compatible dictionary with the expected format of profiles.yml.