This message was deleted.
# ask-marvin
s
This message was deleted.
m
Your message was too long by 9 tokens - please shorten it and try again. For reference, here's your message at the allowed limit:
Prefect isn't detecting task dependencies when I invoke a function manually and use those results in the next task. However, the documentation claims that this would happen automatically. (I can't imagine how that would work, but I was hoping to be pleasantly surprised). The documentation: https://orion-docs.prefect.io/latest/guides/specifying-upstream-dependencies/
Automatic
When a result from a task is used as input for another task, Prefect automatically recognizes the task that result originated from as an upstream dependency.
This applies to every way you can run tasks with Prefect, whether you're calling the task function directly, calling
.submit()
, or calling
.map()
. Subflows similarly recognize tasks results as upstream dependencies.
This other page says that it's a good idea to use either all task invocations (via calls to submit) or all python invocations (calling the method directly) https://orion-docs.prefect.io/latest/concepts/task-runners/?h=submit#using-results-from-submitted-tasks It only warns about task dependency checking in the "mixed use" case: For instance: ``` @task def get_random_number() -> int: return random.randint(0, 100) @task def print_random_number(random_number: int): print(f"The
Your message was too long by 49 tokens - please shorten it and try again. For reference, here's your message at the allowed limit:
Prefect isn't detecting task dependencies when I invoke a function manually and use those results in the next task. However, the documentation claims that this would happen automatically. (I can't imagine how that would work, but I was hoping to be pleasantly surprised). The documentation: https://orion-docs.prefect.io/latest/guides/specifying-upstream-dependencies/
Automatic
When a result from a task is used as input for another task, Prefect automatically recognizes the task that result originated from as an upstream dependency.
This applies to every way you can run tasks with Prefect, whether you're calling the task function directly, calling
.submit()
, or calling
.map()
. Subflows similarly recognize tasks results as upstream dependencies.
This page says it's a good idea to use either all task invocations or all python invocations (calling the method directly) https://orion-docs.prefect.io/latest/concepts/task-runners/?h=submit#using-results-from-submitted-tasks ```@task(log_prints=True) def get_random_number() -> int: return random.randint(0, 100) @task(log_prints=True) def print_random_number(random_number: int) -> None: print(f"The random number is: {random_number}") @flow(log_prints=True) def random_number_flow():