storage_block = Block.load('storage-block')
result = storage_block.read_path(storage_key)
try this.
this should give u the raw result data. might be unpickle depending on how you are storing it
f
flapili
02/23/2023, 2:50 PM
yes but that's not really convenient 😕
flapili
02/23/2023, 2:50 PM
Copy code
# coding: utf-8
from uuid import UUID
from fastapi import FastAPI
from prefect import get_client
from prefect.states import StateType
app = FastAPI(title="Tasks results")
@app.get("/flow_run_state/{state_id}/result")
async def get_task_result(state_id: UUID):
async with get_client() as client:
states = await client.read_flow_run_states(flow_run_id=state_id)
for state in states:
if state.type == StateType.COMPLETED:
result = state.result()
print(await result.get())
flapili
02/23/2023, 2:50 PM
got
ModuleNotFoundError: No module named '__prefect_loader__'
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.