Skip to main content
Version: devel

Profiles

dlt+

This page is for dlt+, which requires a license. Join our early access program for a trial license.

A profile is a set of configurations and secrets defined for a specific use case. Profiles provide a way to manage different configurations for different environments.

They are defined in the dlt.yml under the profiles section.

profiles:
# profiles allow you to configure different settings for different environments
dev:
sources:
my_arrow_source:
row_count: 100
runtime:
log_level: DEBUG
prod:
sources:
my_arrow_source:
row_count: 200
runtime:
log_level: INFO
destinations:
my_duckdb_destination:
credentials: my_data_prod.duckdb

Every project includes two implicit profiles by default: dev and tests. If no profile is specified, the dev profile is loaded by default. All CLI commands that run on a project support the --profile option, allowing you to specify the desired profile. For example,

dlt project --profile dev my_pipeline run
dlt dataset --profile prod my_duckdb_destination_dataset row-counts

Using config files with profilesโ€‹

All the configuration and secrets for profiles can also be placed in TOML files, as described in dlt OSS documentation. Each profile can have its own secrets.toml file, which is only loaded when that profile is active.

For example, if you have two secrets files under .dlt:

.
โ”œโ”€โ”€ .dlt/ # your dlt settings including profile settings
โ”‚ โ”œโ”€โ”€ config.toml
โ”‚ โ”œโ”€โ”€ dev.secrets.toml
โ”‚ โ””โ”€โ”€ tests.secrets.toml

You can run a pipeline with different profiles as follows:

dlt pipeline --profile dev my_pipeline run
dlt pipeline --profile tests my_pipeline run
caution

Please note the following inconsistencies between the YAML and TOML files that will be fixed in the future:

  • The YAML destinations section is singularized to destination in the TOML file.
  • The project variables such as tmp_dir are not available in the TOML files.

Pinning profilesโ€‹

You can pin a profile locally, making the given profile name the default one. This is useful, for example, when deploying your project in a production or staging environment.

dlt profile prod pin

will pin the prod profile and from now on all Python scripts and cli commands will see it as the default and switch to it automatically. The profile pin is kept in the .dlt/profile-name file. Remove this file to unpin. Note that our default .gitignore prevents this file from being added.

Settings in the dlt.yml file vs TOML filesโ€‹

For dlt+ Projects, it's best practice to keep all non-secret settings in dlt.yml and store secrets only in .dlt/secrets.toml. This ensures that sensitive data is only available in the necessary profiles or environments.

In the example above, some non-secret values were moved to .dlt/secrets.toml for demonstration purposes only - this is not the recommended approach.

This demo works on codespaces. Codespaces is a development environment available for free to anyone with a Github account. You'll be asked to fork the demo repository and from there the README guides you with further steps.
The demo uses the Continue VSCode extension.

Off to codespaces!

DHelp

Ask a question

Welcome to "Codex Central", your next-gen help center, driven by OpenAI's GPT-4 model. It's more than just a forum or a FAQ hub โ€“ it's a dynamic knowledge base where coders can find AI-assisted solutions to their pressing problems. With GPT-4's powerful comprehension and predictive abilities, Codex Central provides instantaneous issue resolution, insightful debugging, and personalized guidance. Get your code running smoothly with the unparalleled support at Codex Central - coding help reimagined with AI prowess.