Hi Everyone, I have created a job and want to run ...
# ask-community
k
Hi Everyone, I have created a job and want to run a single simple operation to a run a bash script.
Copy code
@job
def wf_bash():
    hello_world()
@op
def hello_world():
    a = create_shell_script_op("../bin/hello-world.sh", name="bash_hello_world")
    a()
However, I am getting the the following error:
Copy code
dagster._core.errors.DagsterInvalidInvocationError: Compute function of op 'bash_hello_world' has context argument, but no context was provided when invoking.
Does anyone know how I can fix this?
🤖 1
s
It wasn't specified in dagster_shell documentation directly but i believe it's because op is somehow "atomized" piece of software (you can materialize assets with op but I'm not sure about creating other ops), when using graph which is meant to be superset of ops everything works just fine (I guess graph decorator somehow passes context to it's own ops) Try this code 🙂
Copy code
@graph
def hello_world():
    a = create_shell_script_op("../bin/hello-world.sh", name="bash_hello_world")
    a()

wf_bash = hello_world.to_job()
👍 1