Prefect 2.0b9 release: the dataflow is more Pythonic than ever, and you can now securely store Secrets directly in the Prefect UI using a new Secret block!

Big things are in the works for Prefect 2! :rocket:

This release includes breaking changes and deprecations in preparation for Prefect 2 graduating from its beta period to General Availability.

With next week’s release on July 27th, Prefect 2.0 will become the default package installed when you execute:

pip install prefect

Please ensure that your package management process enables you to make the transition to Prefect 2.0 when the time is right for you.

:point_right: Note: Flows written with Prefect 1.0 will require modifications to run with Prefect 2.0

Code as workflows

As Prefect 2 usage has grown, we’ve observed a pattern among users, especially folks that were not previously users of Prefect 1. Working with Prefect was so much like working in native Python, users were often surprised that their tasks returned futures and states, Prefect objects, rather than results, the data that their Python functions were handling. This led to unfamiliar, potentially intimidating, errors in some cases.

With this release, Prefect moves one step closer to code as workflows - tasks now return the results of their functions, rather than their states, by default. This means that you can truly take most native Python scripts, add the relevant @flow and @task decorators, and start running that script as a flow, benefitting from the observability and resilience that Prefect provides.

States and futures are still important concepts in dictating and understanding the behavior of flows. You will still be able to easily access and use them with the .submit() method. You will need to modify tasks in existing Prefect 2 flows to use this method to continue working as before.

Other improvements and bug fixes

  • A new Secret block can store a string that is encrypted at rest as well as obfuscated in logs and the UI
  • Date filters on the flow run page in the UI now support filtering by date and time
  • Each work queue page in the UI now includes a command to start a corresponding agent
  • Tutorials have been updated for increased clarity and consistency
  • Cron schedule setting errors are now more informative
  • Prefect now still works even if the active profile is missing
  • Conda requirements regex now supports underscores and dots
  • The previously deprecated DeploymentSpec has been removed

Release notes

As always, for detailed release notes with links to the relevant PRs, see release notes on GitHub.

3 Likes

This sounds awesome!

I’m fairly confident I know the answer to this question, but requirements.txt or poetry related pyproject.toml files that have the equivalent of prefect==1.2.3, will still work as expected, correct?

3 Likes

You’re spot on! As the Zen of Python says: “Explicit is better than implicit” :smile: as long as you explicitly specify the version, you will avoid any surprises

3 Likes