Jan
07/11/2022, 11:56 AMfrom prefect import task, flow
import time
@flow
def mijn_flow ():
return("just a string")
print(mijn_flow())
The output is:
135451.255 | INFO | prefect.engine - Created flow run 'brainy-parakeet' for flow 'mijn-flow'
135451.271 | INFO | Flow run 'brainy-parakeet' - Using task runner 'ConcurrentTaskRunner'
135451.302 | WARNING | Flow run 'brainy-parakeet' - No default storage is configured on the server. Results from this flow run will be stored in a temporary directory in its runtime environment.
135451.443 | INFO | Flow run 'brainy-parakeet' - Finished in state Completed()
Completed()
Can you point me into the correct direction?
I'm trying to access the return object of my flow (which is a string in this case).Anna Geller
Jan
07/11/2022, 12:33 PMresult = mijn_flow()
print(result.result)
But this gives me this:
<bound method State.result of Completed(message=None, type=COMPLETED, result='just a string')>from prefect import task, flow
import time
@flow
def mijn_flow ():
return("just a string")
result = mijn_flow()
print(result.result('Completed()'))
Is working fine, it just feels sloppy for some reason.Anna Geller
@flow
def mijn_flow():
return "just a string"
if __name__ == "__main__":
flow_state = mijn_flow()
string = flow_state.result()
print(string)
but we are aware that adding .result() anytime you want to access the actual data may be a bit cumbersome and Michael is currently looking into itJan
07/11/2022, 12:50 PM