Giacomo Chiarella
07/28/2023, 1:44 PMNate
07/28/2023, 2:22 PMstr
or Path
) to the flow run so that it can load it from wherever it isGiacomo Chiarella
07/28/2023, 2:25 PMNate
07/28/2023, 2:33 PMIn [10]: from prefect import flow
In [11]: from prefect.filesystems import GCS
In [12]: @flow(log_prints=True)
...: def read_and_use_file(path: str):
...: bucket = GCS.load("marvin-code-storage")
...: return bucket.read_path(path)
...:
In [13]: read_and_use_file("projects/test.py").decode("utf-8")
Out[13]: 'from prefect import flow\n\n@flow(log_prints=True)\ndef hello_world():\n print("Hello, world!")'
Giacomo Chiarella
07/28/2023, 2:34 PMNate
07/28/2023, 2:36 PMGiacomo Chiarella
07/28/2023, 2:37 PMNate
07/28/2023, 2:40 PMsave
and delete
so they could always live for the duration of the flow run
anyways, while uploading files like that is not supported, let me know if there's something else I can help with