Daniel Kim
07/18/2022, 8:30 PM@op
def op1():
return "Some string"
@op(
config_schema={
"name": str
}
)
def op2(context, dummy_str: str):
print(dummy_str)
return f"Hello {context.op_config['name']}"
@graph(
out={
"asset_from_op2": GraphOut()
}
)
def test_graph():
asset_from_op2 = op2(op1())
return {"asset_from_op2": asset_from_op2}
test_asset = AssetsDefinition.from_graph(test_graph, group_name="test_asset")
@repository
def test_repo():
return [
[
test_asset,
define_asset_job(
name="test_asset_job",
config={
"ops": {
"test_graph": {
"ops": {
"op2": {
"config": {
"name": "Daniel"
}
}
}
}
}
}
),
],
]
I run dagit and dagit launches fine. But when I try to materialize this, I get this error:
test_asset_job cannot be executed with the provided config. Please fix the following errors:
Missing required config entry "ops" at the root. Sample config for missing entry: {'ops': {'test_graph': {'ops': {'op2': {'config': {'name': '...'}}}}}}
Been struggling trying to nail down what I'm doing wrong with the config entry. Any help appreciated!jamie
07/18/2022, 8:44 PM{
"ops": {
"op2": {
"config": {
"name": "Daniel"
}
}
}
}
jamie
07/18/2022, 8:46 PMdefine_asset_job
and then open the launchpad in dagit, there will be a scaffold missing config
button in the bottom left. You can also click that and it should fill out a valid config for you. then you can copy that back into the define_asset_job
if you wantDaniel Kim
07/18/2022, 8:50 PMtest_asset_job cannot be executed with the provided config. Please fix the following errors:
Missing required config entry "ops" at the root. Sample config for missing entry: {'ops': {'test_graph': {'ops': {'op2': {'config': {'name': '...'}}}}}}
That's a good tip about removing the config entry! But I'll have to unmaterialize or delete the pickle object to force the scaffolding. It isn't scaffolding anymore I'm guessing because it was materialized earlier.jamie
07/18/2022, 8:52 PMDaniel Kim
07/18/2022, 8:52 PMjamie
07/18/2022, 8:54 PMDaniel Kim
07/18/2022, 8:55 PMjamie
07/18/2022, 8:56 PMjamie
07/18/2022, 9:05 PMdefine_asset_job
• open up dagit and reload your repository
• go to the job and shift + click on "materialize all"
• the launchpad should be empty and the scaffold missing config button should be greyed out
• then click "materialize"
does that work for you?Daniel Kim
07/18/2022, 9:11 PMjamie
07/18/2022, 9:12 PMDaniel Kim
07/18/2022, 9:13 PMjamie
07/18/2022, 9:18 PMDaniel Kim
07/18/2022, 9:26 PMjamie
07/18/2022, 9:31 PM