-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot pass dict as a parameter 'data' to Completed state on Prefect v3.0.0rc16 #14927
Comments
thanks for the issue @ihor-ramskyi-globallogic - we'll take a look here just out of curiosity, what's your use case for passing |
note to self, here's a more concise repro In [1]: from prefect.states import Completed
In [2]: Completed(data={"A": 1})
...
File ~/github.com/prefecthq/prefect/src/prefect/results.py:407, in BaseResult.__new__(cls, **kwargs)
405 return super().__new__(subcls)
406 else:
--> 407 return super().__new__(cls)
TypeError: Can't instantiate abstract class BaseResult without an implementation for abstract methods 'create', 'get' |
@zzstoatzz seems like in this case we should dispatch to an |
I return Failed if task should be failed for any reason - and for unified approach, I use Completed otherwise. So, I still have to return data from the task, and I put it as However, I cannot use type dict for data for Failed state anyways... Because it says it cannot resolve dict in exception. |
@zzstoatzz sorry to bother you, but is there a plan to merge the fix in the near future? |
hi @ihor-ramskyi-globallogic - thanks for the bump i hesitated with that PR because I couldn't reason about the solution, even though it did appear to accomplish the desired outcome. I'll revisit it as soon as I can |
Hi again |
We just made a lot of updates to our results implementation so we will review @zzstoatzz 's for next week's release. If for some reason we decide it's not a viable solution, we will let you know and give you an update on timing. |
@cicdw thanks for the update! |
Bug summary
I cannot pass dict as parameter 'data' on Completed state on Prefect v3.0.0rc16. This is the code on which it fails:
As result of running this code, I get such log and traceback:
logs and traceback
However, same code works correctly (returning Complete state from both the task and the flow), when I run it on Prefect v2.20.0 or when I run it on Prefect v3.0.0rc16 but pass
data=1
,data='abcde'
, or evendata=(1, {'A': 1})
.Version info (
prefect version
output)Additional context
No response
The text was updated successfully, but these errors were encountered: