This PR continues Prefect's 2.0 lineage as we prepare for a major 3.0 release. This release is particularly special with respect to 3.0 as it adds warnings to APIs or interfaces that will need updating in 3.0.
There are many internal APIs in Prefect that can be run both synchronously and asynchronously depending on the runtime context in which they are called. If you've ever encountered the error AttributeError: 'coroutine' object has no attribute
when loading a Block
then you know what I'm referring to. In 3.0 we have updated the internal logic for switching between synchronous/asynchronous modes in an attempt to provide clearer guidelines and improved performance.
If you ever encounter such an error, you can now use the special _sync
keyword argument to explicitly enforce the mode of execution you'd prefer:
my_block = Block.load("example/block", _sync=True)
my_block = await Block.load("example/block", _sync=False)
When this kwarg is not provided, Prefect makes an educated guess as to whether a coroutine should be returned to await or whether to run the logic synchronously on your behalf.
New Features ๐
- Add
container_create_kwargs
to Docker worker by @kevingrismore in #14693 - Expose schema validation flag on deployment flow run create by @cicdw in #14715
- Backport _sync kwarg to 2.x by @cicdw in #14725
- Removal 3 warnings by @WillRaphaelson in #14675
Bug Fixes ๐
- fix task key comp for 2.x by @zzstoatzz in #14707
- Migrates to Kubernetes_asyncio for prefect 2.X by @jeanluciano in #14570
- Fix runtime case for
load_flow_from_entrypoint
in 2.x by @zzstoatzz in #14669
Development & Tidiness ๐งน
- Remove spurious UI change in release notes. by @bunchesofdonald in #14566
- Update github auto-release notes template by @cicdw in #14762
- silence
PrefectDeprecationWarning
in tests by @zzstoatzz in #14708
Full Changelog: 2.19.8...2.19.9