Q
07/12/2023, 3:52 PMresult_storage
I make via .with_options
before calling Deployment.build_from_flow
are ignored, i.e. whatever's set in the flow
decorator call is always used.
Looking at the Deployment.build_from_flow
I get the feeling that all the flow parameters (e.g. result_storage
) are not saved to db, only the entrypoint
is.
And the entrypoint
doesn't get changed by with_options
since it's determined by the name of the underlying (non-Prefect) function, which stays the same.
And so this entrypoint gets called when deployment is run, using whatever's set in the flow
decorator.
Am I missing something here?Deceivious
07/12/2023, 4:05 PM@flow
def flow1():
urstuffhere()
flow2=flow1.with_options(.....)
flow2
it should workQ
07/12/2023, 4:39 PMfn.__name__
and, therefore, the entrypoint don't change), so you'd have to do something like
@flow
def flow1():
urstuffhere()
flow2=flow1.with_options(.....)
flow2.fn.__name__ = "flow2"
But that doesn't work 'cause fn
points to the same object for flow1
and flow2
, so you'd try import copy; ...; flow2.fn = copy.deepcopy(flow1.fn)
but copy.deepcopy
doesn't copy functions so you'd have to do this. Ugh.Flow
class constructor the variable name has to match, so you can't do
def func():
pass
flow1 = Flow(func, **config1)
flow2 = Flow(func, **config2)
Deceivious
07/12/2023, 4:53 PMQ
07/12/2023, 4:55 PMDeceivious
07/12/2023, 4:55 PM@flow
def sub():
urstuffhere()
@flow
def main(storage_id):
sub.with_options(storage=use_storage(storage_id))()
#deploy main twice with 2 different parameters?
Q
07/12/2023, 5:43 PM