<@ULVA73B9P>, Does prefect 3 still support `run_de...
# ask-marvin
r
@Marvin, Does prefect 3 still support
run_deployment
? How to import it?
1
m
In Prefect 3.x, the functionality provided by
run_deployment
does exist, allowing you to run deployments, but there are some compatibility issues and considerations. Here's what I found: 1. Documentation Insights: There isn't explicit documentation from the Prefect 3.x documents directly mentioning
run_deployment
, but related functionality seems to be supported in Prefect through other methods, such as using
serve()
for serving flows and converting flows to deployment objects using
to_deployment
. These methods support similar operations related to deployments. Documentation Link. 2. GitHub Issues: There are known issues related to using
run_deployment
across different versions of Prefect. A common problem is trying to use Prefect 3.x to run a deployment created with Prefect 2.x, which can lead to errors (e.g.,
TypeError: No constructor defined
). It's important to ensure that the deployment environment and client version are compatible. GitHub Issues. To use a similar functionality to trigger deployments in Prefect 3.x, you can look into using the
serve
and the flow conversion methods like
to_deployment
. This showcases how Prefect 3.x allows for serving and managing flows, potentially replacing direct calls to
run_deployment
. If you encounter compatibility issues, you may need to manage version consistency between your client and deployment server or explore alternative methods of triggering flows. Keep an eye on Prefect's updates for any changes in these functionalities.
r
That doesn't seem correct
n
run deployment is in the same spot
from prefect.deployments import run_deployment
it might have been accessible from a different place just bc it happened to be imported in that file
r
Thanks for the quick answer! I got an import error for the following:
from prefect.deployments.deployments import run_deployment
Switched to the following and it works 🙂
from prefect.deployments import run_deployment
👍 1