Different behaviour in prefect future and result between prefect 2 and 3 #17111
-
Hi, I am migrating from prefect 2 to prefect 3, and I do face a problem or difference in behavior. I do run a task like In the task I return e.g. something like Then in prefect 2 I get the actual content of data by running However, in prefect 3 that file_metadata in my case is still an future object and I would find my content at Is this a bug or a feature, or do I miss some eventually newly introduced method or setting? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @OliverKleinBST, thanks for opening a discussion! Can you share a small script where you're seeing this behavior? This sounds like it might be a bug, but I want to fully understand the behavior to be sure. |
Beta Was this translation helpful? Give feedback.
Hi @desertaxle ,
It turned out to be a bug on my end, cause by a wrong import of Failed and Completed I had in my code base - and which for some reason worked still with prefect 2 but breaks the future handling in prefect 3.
For unknown reason I had
from prefect.server.schemas.states import Failed
instead of
from prefect.states import Failed
With the corrected import the .result() problem is gone!