Is there any sort of built-in support for task arg...
# prefect-community
Is there any sort of built-in support for task arguments that can be either a
instance or a raw value? The functionality I’m looking for is basically this:
Copy code
def foo(bar):
    if isinstance(bar, Result):
        bar =
    return do_something(bar)
Clearly the above isn’t hard to add, but it also seems like the kind of thing where (a) there might be hidden gotchas and (b) it seems common enough that
might have something built in
Hey @Ben Fogelson! Can you tell me a little more about what you’re hoping to achieve? Prefect does some of the
unpacking for you under the hood. Are you trying to explicitly pass a
Hey @Dylan, yeah this is what I’m actually trying to do. Say we have two flows: Flow A has a task that produces a large dataframe that we store in google cloud (with the
class). Flow B has a parameter that it expects to be a dataframe. It would be nice if the parameter for Flow B could be either a raw dataframe or some pointer to the location in gcs that prefect automatically unpacks into a dataframe
Or put it another way: it would be nice if the team developing Flow B could write their code just expecting a dataframe and not care whether we instead pass them a reference to the previous result in gcs
Got it
Hey @Dylan, wondering if you were able to find anything out here. Thanks!
Hey @Ben Fogelson, we don’t have anything like this at the moment
However, I think it’s an interesting feature
Definitely feel free to open a feature request issue on the Prefect Core repo!
Thanks Dylan! Will do