Skip to main content

Community-maintained Dagster integration for drt (data reverse tool)

Project description

dagster-drt

PyPI

Community-maintained Dagster integration for drt (data reverse tool).

Expose drt syncs as Dagster assets with full observability — metrics, dependencies, and dry-run support.

Installation

pip install dagster-drt

Quick Start

from dagster import Definitions
from dagster_drt import drt_assets

defs = Definitions(assets=drt_assets(project_dir="path/to/drt-project"))

Features

DagsterDrtTranslator

Customise how drt syncs map to Dagster assets. Subclass and override methods:

from dagster import AssetKey
from dagster_drt import DagsterDrtTranslator, drt_assets

class MyTranslator(DagsterDrtTranslator):
    def get_group_name(self, sync_config):
        return "reverse_etl"

    def get_deps(self, sync_config):
        deps_map = {
            "trigger_bq_meeting_gha": [AssetKey("bq_meeting_cloudsql")],
        }
        return deps_map.get(sync_config.name, [])

assets = drt_assets(
    project_dir="pipeline/data-reverse",
    dagster_drt_translator=MyTranslator(),
)

Available methods:

Method Default Purpose
get_asset_key(sync_config) AssetKey(f"drt_{name}") Asset key
get_group_name(sync_config) None Group name
get_description(sync_config) sync_config.description Asset description
get_deps(sync_config) [] Upstream dependencies
get_metadata(sync_config) {} Static metadata

Dry-Run Support (DrtConfig)

Control dry-run mode per-run from the Dagster UI, or set a build-time default:

# Build-time default: all syncs in dry-run mode
assets = drt_assets(project_dir="...", dry_run=True)

# Override per-run via Dagster UI → Run Config:
# ops:
#   drt_my_sync:
#     config:
#       dry_run: false

MaterializeResult

Assets return MaterializeResult with structured metadata visible in the Dagster UI:

  • sync_name — sync identifier
  • rows_synced — successful row count
  • rows_failed — failed row count
  • rows_skipped — skipped row count
  • dry_run — whether dry-run was active
  • row_errors_count — number of row-level errors (details in logs)

Filtering Syncs

# Only expose specific syncs as assets
assets = drt_assets(
    project_dir="...",
    sync_names=["sync_a", "sync_b"],
)

Usage with dagster-dbt

from dagster import Definitions
from dagster_dbt import dbt_assets
from dagster_drt import drt_assets, DagsterDrtTranslator

defs = Definitions(
    assets=[*my_dbt_assets, *drt_assets("path/to/drt-project")],
)

API Reference

drt_assets()

Parameter Type Default Description
project_dir str | Path required Path to drt project root
sync_names list[str] | None None Filter to specific syncs
dagster_drt_translator DagsterDrtTranslator | None None Custom translator
dry_run bool False Default dry-run mode

Returns: list[AssetsDefinition]

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dagster_drt-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dagster_drt-0.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file dagster_drt-0.1.0.tar.gz.

File metadata

  • Download URL: dagster_drt-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dagster_drt-0.1.0.tar.gz
Algorithm Hash digest
SHA256 229f12dff4da5e2fc6f9a658271cab01890b8c9f61819cc14fa8b93ec1c2a4b2
MD5 9730f7fbda37034d02264123ae38a1d4
BLAKE2b-256 6eb56efdb5b1f9783482e537a05fde28b049a739467c35a4326daf6a29061bcf

See more details on using hashes here.

Provenance

The following attestation bundles were made for dagster_drt-0.1.0.tar.gz:

Publisher: publish-dagster-drt.yml on drt-hub/drt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dagster_drt-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dagster_drt-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dagster_drt-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c011ce991c71dbac61866cca671571c5f7f29ff7d9b3152864fdfbe46f11a8fd
MD5 79ca6df7bef760d275963a5fb6c75472
BLAKE2b-256 36d753edc7deb612e62a101fbec402ff60ca5059047930f3f9ad8540b0a609c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for dagster_drt-0.1.0-py3-none-any.whl:

Publisher: publish-dagster-drt.yml on drt-hub/drt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page