<@ULVA73B9P> This is giving me an error after upgr...
# ask-marvin
j
@Marvin This is giving me an error after upgrading from prefect 2 to prefect 3. What do I need to adjust? for future in context.get_run_context().task_run_futures: future.wait()
m
In Prefect 3.x, there have been changes in how futures are handled, and some methods or attributes may have been modified or deprecated. Here are some key points and adjustments you might need to make: 1. Futures Handling: In Prefect 3.x, futures must be resolved by passing them to another task, returning them, or manually calling
.result()
or
.wait()
. You should ensure that any future objects you are working with are resolved using these methods. 2. Context Handling: The
get_run_context()
method might have undergone changes in Prefect 3.x. Ensure that you are accessing the context and its attributes correctly according to the updated API. 3. Documentation and Examples: Review the relevant documentation for handling futures and context in Prefect 3.x: - Prefect Futures Documentation - Prefect Context Documentation 4. Common Gotchas: Be aware that Prefect 3.x uses Pydantic 2, and server data from Prefect 2.x is not compatible with 3.x. Ensure that your code is updated to accommodate these changes. If you provide more specific error messages or context, I can help further pinpoint the necessary adjustments.