dagster-expert
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDagster Expert Skill
Dagster专业技能指南
Expert guidance for building production-quality Dagster projects. Routes you to detailed reference documentation for assets, automation, project structure, and CLI commands.
IMPORTANT: For new assets, schedules, or sensors, ALWAYS usebefore manual file creation. See cli/scaffold.md.dg scaffoldInvoke EARLY: If the task involves automation conditions, scheduling logic, or integration components (dbt, Fivetran, etc.), invoke this skill or the appropriate sub-skill BEFORE exploring the codebase. The references contain all needed patterns.
为构建生产级Dagster项目提供专业指导,引导你查阅关于asset、自动化、项目结构及CLI命令的详细参考文档。
重要提示:如需创建新的asset、schedule或sensor,手动创建文件前务必使用命令。请查看cli/scaffold.md。dg scaffold尽早调用:如果任务涉及自动化条件、调度逻辑或集成组件(dbt、Fivetran等),在查看代码库前请先调用本技能或对应的子技能。参考文档包含所有所需的实现模式。
Task Router
任务路由
| What do you need? | Reference |
|---|---|
| Create a project | Quick Reference below (use |
| Add an asset/schedule/sensor | cli/scaffold.md (ALWAYS scaffold first) + pattern docs |
| Add integration component (dbt, Fivetran, Airbyte, Snowflake, etc.) | Invoke dagster-integrations skill (contains scaffolding, YAML schema, adapter requirements) |
| Complex scheduling / different triggers per dependency | automation/declarative-automation/README.md |
| Run/materialize assets | cli/launch.md |
| Select specific assets | cli/asset-selection.md |
| List definitions | cli/list.md |
| Validate project | cli/check.md |
| Understand asset patterns | assets.md |
| Understand project layout | project-structure.md |
| Set up automation | automation/README.md |
| Debug/get logs | cli/api.md |
| Configure env vars | env-vars.md |
| Implementation workflow | implementation-workflow.md |
| 你需要什么帮助? | 参考文档 |
|---|---|
| 创建项目 | 下方快速参考(使用 |
| 添加asset/schedule/sensor | cli/scaffold.md(务必先使用脚手架) + 模式文档 |
| 添加集成组件(dbt、Fivetran、Airbyte、Snowflake等) | 直接调用dagster-integrations技能(包含脚手架、YAML schema、适配器要求) |
| 复杂调度 / 基于依赖的不同触发器 | automation/declarative-automation/README.md |
| 运行/物化asset | cli/launch.md |
| 选择特定asset | cli/asset-selection.md |
| 列出定义 | cli/list.md |
| 验证项目 | cli/check.md |
| 理解asset模式 | assets.md |
| 理解项目布局 | project-structure.md |
| 设置自动化 | automation/README.md |
| 调试/获取日志 | cli/api.md |
| 配置环境变量 | env-vars.md |
| 实施工作流 | implementation-workflow.md |
Keyword Router
关键词路由
| Keywords | Reference |
|---|---|
| create project, new project, init, setup | Quick Reference below |
| workspace, multi-project, multiple projects | Quick Reference below |
| scaffold, generate, create asset/schedule/sensor | cli/scaffold.md |
| dbt, fivetran, airbyte, snowflake, bigquery, external tool, integration component, dagster_dbt, dagster_fivetran | Invoke dagster-integrations skill directly |
| complex triggers, different triggers, hot/cold dependencies, conditional automation | automation/declarative-automation/README.md |
| automation_condition, AutomationCondition, eager(), any_downstream_conditions | automation/declarative-automation/README.md |
| list, show, find, discover, what assets | cli/list.md |
| validate, check, verify, test config | cli/check.md |
| launch, run, materialize, execute, backfill | cli/launch.md |
| select, filter, tag, group, kind, upstream, downstream | cli/asset-selection.md |
| logs, debug, troubleshoot run | cli/api.md |
| deploy, plus, cloud | cli/api.md |
| asset, dependency, metadata, partition | assets.md |
| schedule, cron, time-based | automation/schedules.md |
| sensor, event-driven, trigger | automation/sensors/ |
| declarative automation, conditions | automation/declarative-automation/ |
| project structure, code location, definitions | project-structure.md |
| environment variables, env, config | env-vars.md |
| 关键词 | 参考文档 |
|---|---|
| 创建项目, 新项目, 初始化, 搭建 | 下方快速参考 |
| 工作区, 多项目, 多个项目 | 下方快速参考 |
| 脚手架, 生成, 创建asset/schedule/sensor | cli/scaffold.md |
| dbt, fivetran, airbyte, snowflake, bigquery, 外部工具, 集成组件, dagster_dbt, dagster_fivetran | 直接调用dagster-integrations技能 |
| 复杂触发器, 不同触发器, 冷热依赖, 条件自动化 | automation/declarative-automation/README.md |
| automation_condition, AutomationCondition, eager(), any_downstream_conditions | automation/declarative-automation/README.md |
| 列出, 展示, 查找, 发现, 资产列表 | cli/list.md |
| 验证, 检查, 校验, 测试配置 | cli/check.md |
| 启动, 运行, 物化, 执行, 回填 | cli/launch.md |
| 选择, 过滤, 标签, 分组, 类型, 上游, 下游 | cli/asset-selection.md |
| 日志, 调试, 运行故障排查 | cli/api.md |
| 部署, plus, 云 | cli/api.md |
| asset, 依赖, 元数据, 分区 | assets.md |
| schedule, cron, 基于时间 | automation/schedules.md |
| sensor, 事件驱动, 触发器 | automation/sensors/ |
| 声明式自动化, 条件 | automation/declarative-automation/ |
| 项目结构, 代码位置, 定义 | project-structure.md |
| 环境变量, env, 配置 | env-vars.md |
Quick Reference
快速参考
bash
undefinedbash
undefinedProject Setup
项目搭建
uvx create-dagster project <name> --uv-sync # --uv-sync creates venv and installs deps
uvx create-dagster workspace <name> # For multiple related projects
uvx create-dagster project <name> --uv-sync # --uv-sync 参数用于创建虚拟环境并安装依赖
uvx create-dagster workspace <name> # 用于创建多个关联项目的工作区
Output confirms success—no verification needed
输出信息确认创建成功后无需额外验证
Scaffold (ALWAYS use for new definitions)
脚手架(创建新定义时务必使用)
NOTE: Paths are RELATIVE TO defs/ directory, not project root
注意:路径是相对于defs/目录,而非项目根目录
dg scaffold defs dagster.asset assets/my_asset.py
dg scaffold defs dagster.schedule schedules/daily.py
dg scaffold defs dagster.sensor sensors/file_watcher.py
dg scaffold defs dagster.asset assets/my_asset.py
dg scaffold defs dagster.schedule schedules/daily.py
dg scaffold defs dagster.sensor sensors/file_watcher.py
Discover
查看资源
dg list defs
dg list defs --assets "group:analytics"
dg list components
dg list defs
dg list defs --assets "group:analytics"
dg list components
Validate
验证项目
dg check defs
dg check defs
Launch
启动任务
dg launch --assets "tag:priority=high"
dg launch --assets "+my_asset" # with upstream
dg launch --assets my_asset --partition 2024-01-15
undefineddg launch --assets "tag:priority=high"
dg launch --assets "+my_asset" # 包含上游依赖
dg launch --assets my_asset --partition 2024-01-15
undefinedCore Dagster Concepts
核心Dagster概念
Brief definitions only (see reference files for detailed examples):
- Asset: Persistent object (table, file, model) produced by your pipeline
- Job: Selection of assets to execute together
- Schedule: Time-based automation using cron
- Sensor: Event-driven automation that watches for changes
- Declarative Automation: Modern automation where you set conditions on assets
- Partition: Logical division of data (by date, category)
- Component: Reusable, declarative building block (YAML-based)
仅提供简要定义(详细示例请查看参考文档):
- Asset:由数据管道生成的持久化对象(如表格、文件、模型)
- Job:选择要一起执行的asset集合
- Schedule:基于时间的自动化,使用cron表达式
- Sensor:事件驱动的自动化,用于监控变化
- Declarative Automation:现代化自动化方式,可设置asset的触发条件
- Partition:数据的逻辑划分(按日期、类别等)
- Component:可复用的声明式构建模块(基于YAML)
UV Compatibility
UV兼容性
Projects use for dependency management:
uvbash
uv run dg list defs
uv run dg launch --assets my_asset项目使用进行依赖管理:
uvbash
uv run dg list defs
uv run dg launch --assets my_assetRelated Skills
相关技能
- dagster-integrations - Find and configure integration components (dbt, Fivetran, Sling, etc.)
- dagster-integrations - 查找并配置集成组件(dbt、Fivetran、Sling等)",