Thread
#flytekit
    Jay Ganbat

    Jay Ganbat

    5 months ago
    Hi flyte community, happy monday 😆 So I am trying to get some clarification on some task related question: I have a
    regular python task(T1)
    that calls another
    regular python task(T2)
    without it being dynamic; T2 is a very simple function that runs quickly. I did not want to make T1 dynamic since i didnt wanna add overhead of launching pod for T2. Also I am using T2 in a workflow as a regular python task. My question is
    is it a correct way to use it?
    or is it fine to call regular task from another regular task. i could create a regular python function and call that from T1 but then i need to create another wrapper for T2 which just calls the regular function and i wanted to avoid that extra stuff. From this page https://docs.flyte.org/projects/cookbook/en/latest/auto/core/flyte_basics/task.html#sphx-glr-auto-core-flyte-basics-task-py i read that
    You can execute a Flyte task as any normal function.
    maybe i took this statement a bit too liberally
    Follow up question is if it is fine to do this? which works fine in remote execution. However giving me a
    Promise object is not iterable
    error when trying to execute locally.
    Yee

    Yee

    5 months ago
    yeah i don’t think you should do that… sorry
    tasks are not meant to call one another unless dynamic.
    feel free to refactor out into a pure function though, and call from both.
    still patching the other flyteremote issue btw, sorry for the delay, bunch of other changes going in
    Jay Ganbat

    Jay Ganbat

    5 months ago
    oh cool, thanks for the clarification. no worries on the flyteremote 😄
    hi @Yee sorry to bug you again, but does
    Mapped Task
    support local execution? I am getting the similar Promise error
    TypeError: Failed to convert return value for var o0 for function balrog_pipeline.workflows.primer_qc.process_expected_primer_qc_workflow.mapper_calculate_spike_in_metrics_in_fastq_dir_2 with error <class 'TypeError'>: No automatic conversion found from type <class 'flytekit.core.promise.Promise'> to FlyteFile.Supported (os.PathLike, str, Flytefile)
    Yee

    Yee

    5 months ago
    it should yeah. can you start a new thread?
    (we have a slackbot that caches threads)
    Jay Ganbat

    Jay Ganbat

    5 months ago
    sure np
    Yee

    Yee

    5 months ago
    and can you include the function signatures?
    Jay Ganbat

    Jay Ganbat

    5 months ago
    will do.