<https://prefect-community.slack.com/archives/C04D...
# ask-community
c
https://prefect-community.slack.com/archives/C04DZJC94DC/p1763146961194199?thread_ts=1763145223.026799&amp;cid=C04DZJC94DC Is this right that a subflow inherits the
result_storage
from the parent flow, even if the subflow had its own
result_storage
set?
👀 1
n
no
👍 1
sorry, if a child overrides, then that should be respected for the child
👍 1
that's generally how we handle these things, whether its
log_prints
or
result_storage
if children don't specify then they'll inherit but they can opt out
c
Related, I see
get_run_context()
first polls the
TaskRunContext
before the
FlowRunContext
(code). Does this mean that if I'm running a Flow under a Task with
result_storage
set, it will use that
result_storage
instead of its own?
n
do you have some example code that's behaving unexpectedly?
c
Yes 😬 but it's quite convoluted, with a Flow A -> Task -> Flow B, where Flow B is using Flow A's
result_storage
instead of its own. I'll set up a minimal reproducible example if it's helpful.
n
that'd be great, thanks!
c
Copy code
from prefect import flow, task

@flow(log_prints=False)
def flow1():
    print('This should not be logged!') # <- This is logged!

@flow(log_prints=True)
def flow2():
    print('This should be logged!')
    task(flow1)()

if __name__ == "__main__":
    flow2()
This reproduces the problem
Also filed a bug in https://github.com/PrefectHQ/prefect/issues/19449 for reference. Thanks for looking into this earlier
n
oh dang, can reproduce. will take a look
🙏 1
oh interesting
Copy code
task(flow1)()
i didn't even notice that at first
s
I see PR already out, thank you! https://github.com/PrefectHQ/prefect/pull/19450 I imagine it's not a common pattern to have this FlowA -> Task -> FlowB structure we have been running, so we just happened to expose it
❤️ 1
Out of interest, what's the usual cadence from PR merge => new release?
Full context, we are looking at setting up our own build from which we plan to upstream changes to mainline PrefectHQ/prefect
n
its not super uncommon (it should be more common bc its often convenient!) but yea some of the engine machinery had some baked in assumptions from the old world (where tasks were rock bottom, and you couldnt call flows/tasks from them) if your situation allows direct-references, you can install from main once this is merged i.e install
git+<https://github.com/prefecthq/prefect.git@main>
with uv etc or even point at this branch until its merged into main (would not recommend bc we could merge/delete branch at any time)
Out of interest, what's the usual cadence from PR merge => new release?
we release on thursdays
👍 1
s
Ok cool thanks for the context!