Daniel Hurst
01/15/2025, 8:33 AMMarvin
01/15/2025, 8:33 AMDeployment.build_from_flow()
method has been removed. Instead, you should use the from_source()
method to create deployments. Here's a basic example of how you might do this:
python
from prefect import flow
from prefect.deployments import Deployment
@flow
def my_flow():
# Your flow logic here
deployment = my_flow.from_source().deploy(name="my_deployment")
2. Agents to Workers: Prefect 3.x replaces agents with workers. You'll need to configure your infrastructure using work pools instead of the previous infrastructure blocks. More details can be found here.
3. Pydantic V2: Prefect 3.x uses Pydantic V2, which might require adjustments if your flows rely on Pydantic models.
4. Handling Futures: In Prefect 3.x, futures returned by .map
or .submit
are synchronous. You must resolve them by passing them to another task, returning them, or manually calling .result()
or .wait()
.
5. Upgrade Guide: For more detailed information on upgrading, refer to the upgrade guide.
These changes should help you adjust your workflow with minimal disruption. If you have specific questions about your code or setup, feel free to ask!