我对 Python 很陌生,正在学习 Dagster hello 教程
我已经从教程中设置了以下内容
import csv
from dagster import execute_pipeline, execute_solid, pipeline, solid
@solid
def hello_cereal(context):
# Assuming the dataset is in the same directory as this file
dataset_path = 'cereal.csv'
with open(dataset_path, 'r') as fd:
# Read the rows in using the standard csv library
cereals = [row for row in csv.DictReader(fd)]
context.log.info(
'Found {n_cereals} cereals'.format(n_cereals=len(cereals))
)
return cereals
@pipeline
def hello_cereal_pipeline():
hello_cereal()
然而 pylint 显示
参数无值
信息。
我错过了什么?
当我尝试执行管道时,我得到以下信息
D:\python\dag>dagster pipeline execute -f hello_cereal.py -n hello_cereal_pipeline 2019-11-25 14:47:09 - dagster - DEBUG - hello_cereal_pipeline - 96c575ae-0b7d-49cb-abf4-ce998865ebb3 - PIPELINE_START - 开始执行管道“hello_cereal_pipeline”。2019-11-25 14:47:09 - dagster - 调试 - hello_cereal_pipeline - 96c575ae-0b7d-49cb-abf4-ce998865ebb3 - ENGINE_EVENT - 执行过程中的步骤 (pid: 11684) event_specific_data = {"metadata_entries": [["pid" , null, ["11684"]], ["step_keys", null, ["{'hello_cereal.compute'}"]]]} 2019-11-25 14:47:09 - dagster - 调试 - hello_cereal_pipeline - 96c575ae- 0b7d-49cb-abf4-ce998865ebb3 - STEP_START - 开始执行步骤“hello_cereal.compute”。固体=“你好谷物” solid_definition = "hello_cereal" step_key = "hello_cereal.compute" 2019-11-25 14:47:10 - dagster - 错误 - hello_cereal_pipeline - 96c575ae-0b7d-49cb-abf4-ce998865ebb3 - STEP_FAILURE - 步骤“hello_cereal.compute”的执行失败. cls_name = “FileNotFoundError”solid = “hello_cereal”solid_definition = “hello_cereal” step_key = “hello_cereal.compute”
文件“c:\users\kirst\appdata\local\programs\python\python38-32\lib\site-packages\dagster\core\errors.py”,第 114 行,在 user_code_error_boundary 产量文件“c:\users\kirst \appdata\local\programs\python\python38-32\lib\site-packages\dagster\core\engine\engine_inprocess.py",第 621 行,在 _user_event_sequence_for_step_compute_fn 中用于 gen 中的事件:文件 "c:\users\kirst\appdata \local\programs\python\python38-32\lib\site-packages\dagster\core\execution\plan\compute.py”,第 75 行,在 _execute_core_compute 中用于 _yield_compute_results(compute_context,inputs,compute_fn)中的 step_output:文件“c :\users\kirst\appdata\local\programs\python\python38-32\lib\site-packages\dagster\core\execution\plan\compute.py",第 52 行,在 user_event_sequence 中的事件的 _yield_compute_results 中:文件“c:\users\kirst\appdata\local\programs\python\python38-32\lib\site-packages\dagster\core\definitions\decorators.py”,第 418 行,计算结果 = fn(context, * *kwargs) 文件“hello_cereal.py”,第 10 行,在 hello_cereal 中,open(dataset_path, 'r') 作为 fd:
2019-11-25 14:47:10 - dagster - 调试 - hello_cereal_pipeline - 96c575ae-0b7d-49cb-abf4-ce998865ebb3 - ENGINE_EVENT - 在 183 毫秒内完成的过程中的步骤 (pid: 11684) event_specific_data = {"metadata_entries": [[" pid", null, ["11684"]], ["step_keys", null, ["{'hello_cereal.compute'}"]]]} 2019-11-25 14:47:10 - dagster - 错误 - hello_cereal_pipeline - 96c575ae-0b7d-49cb-abf4-ce998865ebb3 - PIPELINE_FAILURE - 管道“hello_cereal_pipeline”的执行失败。
[更新] 从 Rahul 的评论中,我意识到我没有复制整个示例。当我纠正我得到 FileNotFoundError