https://prefect.io logo
r

Ricardo Gaspar

04/07/2022, 12:11 PM
Iā€™m migrating my flow code from prefect 0.15 to orion
2.0.b2
. do you know where the
resource_manager
is located now? Before I was importing
from prefect import resource_manager
https://docs.prefect.io/core/idioms/resource-manager.html CC @Anna Geller @Kevin Kho
a

Anna Geller

04/07/2022, 12:15 PM
Great news: you just no longer need the resource manager! šŸ™‚ Instead, you can use any Python context manager to facilitate a cleanup process, such as restoring various kinds of a global state, locking and unlocking resources, closing opened files, etc. This page dives into details
in general, for migration-specific questions, check out this Discourse tag that has resources that may help you with migration
r

Ricardo Gaspar

04/07/2022, 12:20 PM
oh nice. thank you so much anna!
šŸ‘ 1
Thanks for the example. The example there, is still valid for creating an EMR/Spark cluster ? just a function with a try/finally block instead of a dedicated class?
a

Anna Geller

04/07/2022, 5:03 PM
Yup exactly!
šŸ‘Œ 1
7 Views