Ho Ho Ho :santa: We’re currently running our flow...
# ask-community
m
Ho Ho Ho 🎅 We’re currently running our flows on Prefect 2.20.0, deploying them via CLI like this:
Copy code
prefect deployment build app.py:xy_flow -n xy -p prod -q prod-queue --override image="IMAGE_NAME" --apply
We’re using Prefect Cloud, which seems to be on version 3.x now. Recently, we’ve started seeing this notice when running our flows:
Copy code
/usr/local/lib/python3.11/site-packages/prefect/engine.py:427: PrefectDeprecationWarning: 
prefect.deployments.deployments.load_flow_from_flow_run has been deprecated. 
It will not be available after Dec 2024. 
Will be moved in Prefect 3 to prefect.flows:load_flow_from_flow_run
This raises a few questions for us: 1. What does this notice mean? Is it about compatibility issues between Prefect 2.x and the current cloud version? 2. Is Prefect 2.x still supported? How long can we rely on it? 3. What happens after December 2024? Will our flows stop working? 4. What should we do now? Would you recommend migrating to Prefect 3.x immediately? Thanks in advance 🙂 @Marvin Marvin do you have any ideas?
m
Oops, it seems I forgot to specify some queries for searching the Prefect documentation. Let's fix that up and get you sorted out with answers to your questions. Give me another moment! Ho Ho Ho, let's unpack these gifts of information for you! 1. What does this notice mean? The notice you're seeing about
PrefectDeprecationWarning
indicates that certain functions are being deprecated, specifically
load_flow_from_flow_run
. This is a normal part of software development where outdated or improved-upon features are marked for future removal. The notice suggests that Prefect 3.x will have this function in a new module called
prefect.flows
. You can read more about deprecations in Prefect 2.x here. 2. Is Prefect 2.x still supported? Yes, Prefect 2.x is still supported. Prefect aims to maintain backwards compatibility. However, deprecated features may be removed in future releases. Prefect 3 introduces enhancements while maintaining compatibility with most 2.x workflows, but with some exceptions. More on compatibility here. 3. What happens after December 2024? The notice specifies that the
load_flow_from_flow_run
function won't be available after December 2024. Your flows won't magically stop, but you may need to update your code to comply with newer versions. More details on upgrading can be found here. 4. What should we do now? It would be prudent to start planning a migration to Prefect 3.x. The transition should be seamless for most, with minimal code changes necessary. Consider the benefits of new features in Prefect 3, like enhanced event-driven workflows and improved runtime performance. If you have any more questions, feel free to ask. I can't promise a pain-free upgrade, but I can promise sarcasm-free help!
a
Prefect Cloud is backwards compatible with all versions. It means that after December 2024 that Prefect will remove this function from the python package. So you won’t be able to upgrade to new package versions unless you change your import. tl;dr If you never upgrade your package you don’t need to make any changes. If you want to upgrade even minor versions of 2.X you may want to start addressing that deprecation warning
m
ok thanks 🙂