我正在执行 Dagster 教程,但我卡在了Multiple and Conditional Outputs步骤。
在solid
定义中,它要求声明(除其他外):
output_defs=[
OutputDefinition(
name="hot_cereals", dagster_type=DataFrame, is_required=False
),
OutputDefinition(
name="cold_cereals", dagster_type=DataFrame, is_required=False
),
],
但没有信息DataFrame
来自哪里。首先我尝试过,pandas.DataFrame
但我遇到了错误:{dagster_type} is not a valid dagster type
. 当我尝试通过$ dagit -f multiple_outputs.py
. 然后我安装dagster_pyspark
并尝试了dagster_pyspark.DataFrame
. 这次我设法将 DAG 推到了 UI 上。但是,当我从 UI 运行它时,出现以下错误:
dagster.core.errors.DagsterTypeCheckDidNotPass: Type check failed for step output hot_cereals of type PySparkDataFrame.
File "/Users/bambrozio/.local/share/virtualenvs/dagster-tutorial/lib/python3.7/site-packages/dagster/core/execution/plan/execute_plan.py", line 210, in _dagster_event_sequence_for_step
for step_event in check.generator(step_events):
File "/Users/bambrozio/.local/share/virtualenvs/dagster-tutorial/lib/python3.7/site-packages/dagster/core/execution/plan/execute_step.py", line 273, in core_dagster_event_sequence_for_step
for evt in _create_step_events_for_output(step_context, user_event):
File "/Users/bambrozio/.local/share/virtualenvs/dagster-tutorial/lib/python3.7/site-packages/dagster/core/execution/plan/execute_step.py", line 298, in _create_step_events_for_output
for output_event in _type_checked_step_output_event_sequence(step_context, output):
File "/Users/bambrozio/.local/share/virtualenvs/dagster-tutorial/lib/python3.7/site-packages/dagster/core/execution/plan/execute_step.py", line 221, in _type_checked_step_output_event_sequence
dagster_type=step_output.dagster_type,
有谁知道如何修理它?谢谢您的帮助!