Hi everyone, nice to meet you all. I've a doubt: S...
# ask-community
Hi everyone, nice to meet you all. I've a doubt: Suppose i have an @op without output, but with an asset materialization.
Copy code
@op(ins={"path": In(str)})
def my_op(conxtext, path):
    metadata = load_file_into_data_lake(path)
    yield AssetMaterialization(
it raises an error:
dagster.core.errors.DagsterStepOutputNotFoundError: Core compute for op "<op_name>" did not return an output for non-optional output "result"
. I imagine that the asset materialization event requires an output, is that true? Nevertheless i found a workaround with:
Copy code
    ins={"path": "<cloud://cloud_path>"},
    out={"result": Out(Nothing)}  # workround
def my_op(conxtext, path):
I forget where, but I recall reading that if an asset is yielded, an output must also be yielded, so that’s a reasonable workaround. Sometimes, I’ll just put a
yield Output(True)
on ops that materialize assets but don’t need to actually return anything; your approach is likely better 🙂
👍 1
Alex's answer is correct, but another option is to use
instead of yielding the event.
💯 1
Thanks you all! I'll switch to Owen's approach, definitely cleaner.