SantanM
12/20/2024, 6:25 AMartifacts/filter
was returning the flowrun metadata and that contains the storage location information. But it is no longer the case now (maybe because results are not artifacts).
Can someone help here, please?SantanM
12/23/2024, 2:01 AMNate
12/23/2024, 6:00 AMimport asyncio
from prefect import task
from prefect.results import ResultStore
@task(
persist_result=True,
result_storage_key="my-storage-key",
)
def add_em_up(x: int, y: int) -> int:
return x + y
async def main():
add_em_up(42, 42)
record = await ResultStore().aread("my-storage-key")
assert record.result == 84, "expected a result of 84"
print(record.model_dump_json(indent=2))
if __name__ == "__main__":
asyncio.run(main())
Nate
12/23/2024, 6:01 AM» python sandbox/proofs/load_saved_result.py
23:59:33.876 | INFO | Task run 'add_em_up' - Finished in state Cached(type=COMPLETED)
{
"metadata": {
"storage_key": "/Users/nate/.prefect/storage/my-storage-key",
"expiration": null,
"serializer": {
"type": "pickle"
},
"prefect_version": "3.1.10.dev2",
"storage_block_id": null
},
"result": 84
}
SantanM
12/23/2024, 6:08 AMSantanM
12/23/2024, 6:27 AMflowrun id
?Nate
12/23/2024, 3:48 PMSantanM
12/23/2024, 4:44 PMthere are many reasons for this, the main one is that results are often sensitiveYes, I understand this @Nate In Prefect v2,
artifacts/filter
endpoint was returning (S3) location of the generated result of a flowrun/taskrun. It seems in Prefect V3 this behaviour has changed and the response from the endpoint does not include result storage location information.
Is there a way to retrieve result storage information (eg: S3 bucket path) of a flowrun/taskrun ?Nate
12/23/2024, 4:45 PMSantanM
12/27/2024, 11:30 AM