Skip to content
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

wrap validate State.data #14936

Closed
wants to merge 3 commits into from
Closed

wrap validate State.data #14936

wants to merge 3 commits into from

Conversation

zzstoatzz
Copy link
Collaborator

@zzstoatzz zzstoatzz commented Aug 14, 2024

closes #14927

example

from prefect.results import UnpersistedResult
from prefect.states import Completed

if __name__ == "__main__":
    state = Completed(data=UnpersistedResult.create("foo"))
    print(state.result())

    other_state = Completed(data={"A": 1})
    print(other_state.result())
» python repros/14927.py
foo
{'A': 1}

return handler(v, info)
except TypeError as e:
# allow backwards compatibility, i.e. `Completed(data={"A": 1})`
if "Can't instantiate abstract class" in str(e):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it feels like we should be able to change BaseResult to avoid this entirely, but I haven't figured out how to do that yet

Copy link

codspeed-hq bot commented Aug 14, 2024

CodSpeed Performance Report

Merging #14936 will not alter performance

Comparing return-state-data (c39c8d1) with main (2b994af)

Summary

✅ 3 untouched benchmarks

@zzstoatzz zzstoatzz marked this pull request as ready for review August 16, 2024 16:14
@github-actions github-actions bot added the bug Something isn't working label Aug 16, 2024
@zzstoatzz zzstoatzz marked this pull request as draft August 16, 2024 16:14
Copy link
Contributor

This pull request is stale because it has been open 14 days with no activity. To keep this pull request open remove stale label or comment.

@zzstoatzz
Copy link
Collaborator Author

superseded by #15506

@zzstoatzz zzstoatzz closed this Sep 26, 2024
@zzstoatzz zzstoatzz deleted the return-state-data branch September 26, 2024 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status:stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot pass dict as a parameter 'data' to Completed state on Prefect v3.0.0rc16
1 participant