https://prefect.io logo
#prefect-community
Title
# prefect-community
w

wonsun

06/03/2022, 1:31 AM
Hi.. I got this error `ValueError: A
path
must be provided to show where flow
.py
file is stored.` My flow code like this!
Copy code
with Flow('flow_step1', storage=Local()) as flow:
    engine = create_engine('<mysql+pymysql://wonsun.jeong>:~~~~~~~~~~~~~~~', echo=True)
    connection = engine.connect()
    
    before = check_db()
    after = check_storage()
    
    answer = coin_inspection(after, before)
    
    with case(answer, False):
        new_datas = action_if_false()
        raw_extract = each_file_info.map(new_datas)
        final = each_ecg_meta.map(raw_extract)
        
    with case(answer, True):
        action_if_true()
           

flow.storage = Local(stored_as_script=True)
flow.register(project_name='try')
flow.run() 
# flow.visualize()
This python file name is 'flow_step1.py'. What's the problem?? Also, most weird thing is window(local) already run 'flow_step1' and create result files but prefect web UI can't detect this flow! I'm so confused because i don't understand exactly Flow, Register, Agent, Server, Local, Path.. in Prefect. Help me please.. 🤯
k

Kevin Kho

06/03/2022, 1:50 AM
If using
stored_as_script=True
, you need to point to where the file lives with
path
.
Copy code
flow.storage=Local(path=...,stored_as_script=True
❤️ 1
w

wonsun

06/03/2022, 1:59 AM
The file you mentioned is the python code for define flow? In this case write this.
flow.storage=Local(path='C:\\Users\\user\\.prefect',stored_as_script=True)
Right?
k

Kevin Kho

06/03/2022, 2:11 AM
Yep the doc string will have more detail
w

wonsun

06/03/2022, 5:37 AM
Thanks Kevin! Don't panic..😂
🙌 1
7 Views