Cody
06/27/2023, 8:13 PMprefect deploy path\to\file.py:flow_name
Throwing a AttributeError: 'NoneType' object has no attribute 'name'
error?
I'm using windows 10 powershell, my python version is 3.11.3, and prefect version is 2.10.14.
Updating from prefect 2.10.14 to 2.10.17 the error changes to ModuleNotFoundError: No module named 'resource'
Here's my super basic flow -
import httpx
from prefect import flow, task
@task
def fetch_cat_fact():
return httpx.get("<https://catfact.ninja/fact?max_length=140>").json()["fact"]
@task
def formatting(fact: str):
return fact.title()
@task
def write_fact(fact:str):
with open("fact.txt", "w+") as f:
f.write(fact)
return "Success!"
@flow(name='pipe')
def pipe():
fact = fetch_cat_fact()
formatted_fact = formatting(fact)
msg = write_fact(formatted_fact)
print(msg)
I've seen some others who ran into the issue.