Hi! I'm really new to dagster and I'm trying to us...
# random
i
Hi! I'm really new to dagster and I'm trying to use dagster-shell. could anyone point me to an example on how to use the shell_op? Thanks!!
m
Did you see the examples in the API docs? https://docs.dagster.io/_apidocs/libraries/dagster-shell#apis
i
Yes and this is working fine, but this is using the create_shell_command_op. In the explenation it is written that in case one wants to generate commands dynamically one should use the shell_op, but there is no example for that.
m
Copy code
from dagster import job, op
from dagster_shell import shell_op

@op
def shell_greeting():
    return 'echo "this is a test message"'

@op
def show_output(msg):
    print("The output was: " + msg)

@job()
def shell_hello_job():
    show_output(shell_op(shell_greeting()))

if __name__ == "__main__":
    result = shell_hello_job.execute_in_process()
i
Thanks a lot!!!
m
i
Thanks for your replay, it was really helpful!