https://prefect.io logo
Title
b

Bertangela Loret de Mola

07/31/2022, 9:54 PM
Hi Prefect family. I'm running the example below in Visual Studio Code in my local machine Windows 10 and getting the error displayed. Any guidance?
k

Khuyen Tran

08/01/2022, 12:50 AM
I couldn’t see the error very well. Could you paste it here?
also I don’t see the use of
fn
in your code
b

Bertangela Loret de Mola

08/01/2022, 12:51 PM
Exactly, I'm not using Fn
The error says: 'fn' must be callable
It is a TypeError
m

Mason Menges

08/01/2022, 3:05 PM
Hey @Bertangela Loret de Mola what version of prefect are you running?
b

Bertangela Loret de Mola

08/01/2022, 3:10 PM
m

Mason Menges

08/01/2022, 3:22 PM
So the syntax for your code is written for 1.0 it should actually look more like this
import prefect
from prefect import task, flow

@task
def hello_task():
    logger = prefect.logging.get_run_logger()
    <http://logger.info|logger.info>("Hello World!")

@flow
def hello_flow():
    hello_task()

hello_flow()
basically you can define a flow as you would any other python function with just a simple task decorator and then just call the function to run it. I'd also suggest updating to the latest version of prefect as we're no longer in Beta there have been a lot of changes to the functionality 😄
b

Bertangela Loret de Mola

08/01/2022, 3:32 PM
Thank you Mason. How do I update the prefect version? I did: "pip install prefect"
On the other hand, the code you sent is giving me this error: raise util.CommandError(resolution) from re alembic.util.exc.CommandError: Can't locate revision identified by '88c2112b668f'
can you pleas assist?
m

Mason Menges

08/01/2022, 3:41 PM
pip install prefect
should install the latest version, are you running in a virtual environment? if you are you might try starting in a clean environment and install prefect there and try again, I'm not getting any errors when running the code snippet but let me know if you still do when running it in a new environment or after removing and reinstalling prefect.
b

Bertangela Loret de Mola

08/01/2022, 5:02 PM
yeah, I'm in a virtual environment. Will try and let you know. Thanks
c

Chris L.

08/06/2022, 3:16 AM
@Bertangela Loret de Mola Hey I got the same problem, unsure about the root cause, but a quick (but potentially destructive) solution is to delete
.prefect
directory (most likely to be in $HOME). Orion started up without issue after