@dagster-io/dagster-pipes

中文文档
0.1.0发布于 2025/02/21Apache-2.0TypeScriptCommonJS零依赖近 30 天下载 3417
中文使用文档
文档目录8 节
  1. 使用量
  2. 先决条件
  3. 安装
  4. 示例
  5. 发展
  6. 正在编译开发版本
  7. 测试
  8. 线性

dagster-pipe-typescript

排字程序语言的管道执行 .

允许任何打字程序与 Dagster 管弦乐器之间的融合 .

使用量

先决条件

安装

@dagster-io/dagster-pipes 作为 npm 软件包可用 :

npm install @dagster-io/dagster-pipes

示例

除了下面的例子之外,您还可以找到一个带有打字管道资产的示例 example-project/ 目录.

安装后 @dagster-io/dagster-pipes npm 软件包, 您的打字程序可以导入它与 dagster 集成 .

import * as dagster_pipes from '@dagster-io/dagster-pipes';

using context = dagster_pipes.openDagsterPipes()

context.logger.info("this is a log message from the external process")
context.logger.warning("This is an example warning from the external process")

context.reportAssetMaterialization(
    {
        "row_count": 100
    }
)
context.reportAssetCheck(
    "example_typescript_check", true
)

在达克斯特管弦乐法中,增加以下内容:

import subprocess
from pathlib import Path
import dagster as dg

@dg.asset(
    check_specs=[
        dg.AssetCheckSpec(
            name="example_typescript_check",
            asset="example_typescript_asset"
        )
    ]
)
def example_typescript_asset(
    context: dg.AssetExecutionContext, 
    pipes_subprocess_client: dg.PipesSubprocessClient
) -> dg.MaterializeResult:
    external_script_path = dg.file_relative_path(__file__, "../external_typescript_code/")
    
    subprocess.run(["npm install"],
                    cwd=external_script_path).check_returncode()
    subprocess.run(["tsc"],
                   cwd=external_script_path).check_returncode()

    return pipes_subprocess_client.run(
        command=["node", Path(external_script_path)],
        context=context,
    ).get_materialize_result()


defs = dg.Definitions(
    assets=[example_typescript_asset],
    resources={
        "pipes_subprocess_client": dg.PipesSubprocessClient()
    },
)

发展

正在编译开发版本

npm install && npm run build

测试

npm test
uv run --all-extras pytest

线性

npm run lint

版本与发布记录

@dagster-io/dagster-pipes 共发布 1 个版本,首次发布于 2025/02/21;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.1.0latest2025/02/211.7 年前

关于 @dagster-io/dagster-pipes 的常见问题

@dagster-io/dagster-pipes 是什么?

管道协议的打字符执行,与 https://github.com/dagster-io/dagster 页面存档备份,存于互联网档案馆

如何安装 @dagster-io/dagster-pipes?

在项目目录运行 npm install @dagster-io/dagster-pipes,或使用 pnpm add / yarn add / bun add。

@dagster-io/dagster-pipes 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@dagster-io/dagster-pipes 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@dagster-io/dagster-pipes 可以商用吗?

@dagster-io/dagster-pipes 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@dagster-io/dagster-pipes 的下载量有多少?

根据 npm 官方下载统计,@dagster-io/dagster-pipes 在 2026/10/11 – 2026/11/09 这 30 天内被下载 3,417 次,日均约 114 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@dagster-io/dagster-pipes 还在维护吗?

最新版本 0.1.0 发布于 2025/02/21(1.7 年前);至今共发布 1 个版本,其中过去 12 个月发布了 0 个;首次发布于 2025/02/21。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。