Install & Compatibility
Where this runs
tested against v0.29.9 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.915 runs
installs and imports cleanly · install 0.0s · import 4.186s · 225.1MB
glibcpy 3.10–3.915 runs
installs and imports cleanly · install 20.4s · import 3.899s · 224MB
237MB installed
● package 237MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
dlt_assets
✓ from dagster_dlt import dlt_assets
DagsterDltResource
✓ from dagster_dlt import DagsterDltResource
pipeline
✓ from dlt import pipeline
DltLoadCollectionComponent
✓ from dagster_dlt import DltLoadCollectionComponent
✗ from dagster_embedded_elt.dlt import DltLoadCollectionComponent
The `DltLoadCollectionComponent` was moved from `dagster-embedded-elt` to `dagster-dlt`.
This quickstart demonstrates how to define Dagster assets from a dlt source and pipeline using the `@dlt_assets` decorator. It sets up a simple in-memory dlt source and a dlt pipeline that loads data to a local DuckDB file, then orchestrates this with Dagster. The `DagsterDltResource` is used to execute the dlt pipeline within the Dagster asset context. Remember to replace `my_in_memory_source` with your actual dlt source definition.
import os
from dagster import Definitions, AssetExecutionContext
from dagster_dlt import DagsterDltResource, dlt_assets
import dlt
# Assuming you have a dlt source defined, e.g., in `my_dlt_source.py`
# For this example, we'll create a minimal in-memory source.
# In a real scenario, this would import from your dlt source module.
@dlt.source
def my_in_memory_source(item_count: int = 3):
@dlt.resource
def my_items():
for i in range(item_count):
yield {'id': i, 'value': f'item_{i}'}
return my_items
# Configure a dlt pipeline to load to a local DuckDB file
my_pipeline = dlt.pipeline(
pipeline_name="my_dagster_dlt_pipeline",
destination="duckdb",
dataset_name="my_data",
progress="log",
credentials={'database': './my_dagster_dlt_data.duckdb'}
)
# Define Dagster assets using the @dlt_assets decorator
@dlt_assets(
dlt_source=my_in_memory_source(item_count=5),
dlt_pipeline=my_pipeline,
name="my_dlt_assets",
group_name="dlt_ingestion"
)
def my_dagster_dlt_assets(context: AssetExecutionContext, dlt_resource: DagsterDltResource):
# The dlt_assets decorator automatically generates assets from the dlt source's resources.
# The function body is where you trigger the dlt pipeline run.
# The yielded results will be converted to Dagster materializations.
yield from dlt_resource.run(my_pipeline, my_in_memory_source(item_count=5))
# Combine assets and resources into Dagster Definitions
defs = Definitions(
assets=[my_dagster_dlt_assets],
resources={
"dlt": DagsterDltResource(
# It's good practice to pass any DLT credentials via environment variables
# or Dagster secrets/resources if they are sensitive.
# For DuckDB, a file path is often direct.
)
}
)
# To run this:
# 1. Save as `__init__.py` in a Dagster project (e.g., `my_project/my_dagster_dlt_example/__init__.py`)
# 2. Run `dagster dev` in the parent directory of `my_project`
# 3. Open the Dagster UI (Dagit), locate 'my_dlt_assets' and materialize it.
# 4. Check `my_dagster_dlt_data.duckdb` for the loaded data.
Debug
Known issues
breakingThe `dagster-dlt` library was introduced as a standalone package, replacing the `dlt` module previously found within `dagster-embedded-elt`.fixUpdate imports from `dagster_embedded_elt.dlt` to `dagster_dlt`. Specifically, `DagsterDltResource` and `dlt_assets` should now be imported from `dagster_dlt`.
affects: Dagster versions 1.12.0 and later.
deprecatedThe `dlt_dagster_translator` parameter in the `@dlt_assets` decorator was deprecated and renamed.fixUse the `dagster_dlt_translator` parameter instead of `dlt_dagster_translator` when defining custom translation logic for dlt resources to Dagster assets.
affects: Dagster versions 1.8.0 and later.
gotchadlt relies on environment variables for managing connections and secrets to sources and destinations. Failure to configure these will lead to pipeline failures.fixEnsure all required dlt environment variables (e.g., API keys, database credentials) are set in the environment where your Dagster process runs, or configure them via Dagster's resource configuration and pass them to your dlt pipeline.
affects: All versions
gotchaWhen using DuckDB as a destination for multiple dlt assets, concurrent writes can lead to file locking errors (`IO Error: Cannot open file...`).fixTo avoid concurrent access issues with DuckDB, either use a database that supports multi-process transactions (e.g., PostgreSQL, MySQL), write data to Parquet files and have DuckDB read from them, or ensure that only one dlt asset targeting the same DuckDB file is materialized at a time (e.g., by limiting Dagster's concurrency).
affects: All versions where DuckDB is used as a destination.
gotchaWhen materializing multiple dlt assets, intermittent `PermissionError: [WinError 5] Access is denied: for state.json` errors can occur, especially on Windows.fixThis issue often stems from concurrent access to dlt's `state.json` files. Ensure each dlt asset uses a unique pipeline name and dataset, and consider limiting Dagster's concurrency (`max_concurrent_runs: 1`) if the problem persists.
affects: All versions, particularly on Windows.
Upgrade
Version history
0.29.9latest on PyPI · released Jun 11, 2026
Audit
Dependencies
dltrequiredCore library for ETL/ELT functionality, implicitly installed as a dependency.
dagsterrequiredMain orchestration framework; dagster-dlt is an integration for it.
dagster-webserverrequiredProvides the Dagster UI for monitoring and managing assets and runs.