Alex Cano
01/31/2020, 6:12 PMAttributeError: Context object has no attribute dict
. Can anyone spot something wrong with the flow (like structurally or conceptually)?
from prefect import Flow, task
from prefect.environments.storage import Local
@task
def extract():
return [1, 2, 3]
@task
def always_process_and_pass_downstream(element: int) -> int:
return element * 2
@task
def load(elements: List[int]) -> None:
total = sum(elements)
@task
def process_and_finish(element: int) -> None:
avg = sum(element) / len(element)
pass
with Flow("test client register flow 1", storage=Local()) as flow:
extracted = extract()
processed = always_process_and_pass_downstream(element=extracted, mapped=True)
process_and_finish(element=processed)
load(elements=processed)
result = flow.run()
Thanks!Chris White
01/31/2020, 6:14 PMAlex Cano
01/31/2020, 6:17 PMChris White
01/31/2020, 6:18 PMAlex Cano
01/31/2020, 6:20 PMprefect.utilities.context
file and tried to execute that file to see what the context object looks like, and I think the error is not prefect related. I’m getting a ImportError: cannot import name 'namedtuple' from 'collections'
, which screams I screwed this up somehow hahaChris White
01/31/2020, 6:21 PMAlex Cano
01/31/2020, 6:22 PMnamedtuple
from prefect.utilities.collections
instead of just collections
. Oh the joys of python’s import system