Hello (again) Flyte community. I've got a relativ...
# ask-the-community
b
Hello (again) Flyte community. I've got a relatively simple question about ShellTasks returning promises when called inside a task and what the best approach is for wanting to evaluate or do any kind of computation with the returned values. Can you force a promise to execute (translate_inputs_to_literals) within a task? My basic approach that is failing:
Copy code
my_shelltask = ShellTask(
    name="the_shelltask",
    debug = True,
    script="""
        runs some shell code with {inputs.input1} and {inputs.input2}

    """,
    inputs=kwtypes(
        input1=some_value, 
        input2=some_other_value
    ), 
    output_locs=[
        OutputLocation(var='output1', var_type=FlyteFile, location="/tmp/output1.file"), 
        OutputLocation(var='output2', var_type=FlyteFile, location="/tmp/output2.file")
    ]
  
)


@task
def run_shelltask(MyDataClass, input1 = input1, input2 = input2) -> Tuple[MyDataClass, FlyteFile, FlyteFile]:
        
    output1, output2 = my_shelltask(input1=input1)

    return MyDataClass, output1, output2
k
Interesting, a task invoked inside a task should be a simple python function invocation
This looks like a bug
Is this when you execute locally
b
something unique to ShellTask I've simply made my own subprocess convenience task in the interim
local, yes
k
ahh
this can be fixed - please file an issue and we will get to it
150 Views