Samarth
06/09/2022, 2:35 PMLocal
storage and Prefect Cloud
I want to use stored_as_script=True
for my flow (pickle storage is not working with an SQLAlchemy object for some reason), and so I need to specify path
— but that is giving me an error. Sharing the relevant code snippet and error.
with Flow(
"eco_flow",
schedule=schedule,
storage=Local(stored_as_script=True, path='~/.prefect/flows/test-flow.py')
) as flow:
cities = ['mumbai', 'new-delhi']
for city in cities:
data = get_traffic_data(city)
clean_data = clean_traffic_data(data)
insert_to_db(clean_data)
Error after registering the flow: Failed to load and execute flow run: ModuleNotFoundError("No module named '~/'")
I guess I am defining the path
incorrectly?Kevin Kho
06/09/2022, 2:47 PMfrom path... import flow
like thatSamarth
06/09/2022, 3:29 PM