Prefect is a workflow orchestration tool empowering developers to build, observe, and react to data pipelines
APACHE-2.0 License
Bot releases are hidden (Show)
Published by zangell44 4 months ago
We're excited to announce the release candidate of Prefect 3.0. It's the most flexible, powerful, fastest version of Prefect yet. Prefect 3.0 includes several exciting new features. Install it by running pip install prefect==3.0.0rc2
and check out the docs here.
You can now run and serve tasks outside of flows and inside of other tasks.
from prefect import task
@task
def my_background_task(name: str):
print(f"Hello, {name}!")
if __name__ == "__main__":
my_background_task.delay("ford")
Use rollback and commit hooks to facilitate idempotent python code.
from prefect import flow, task
from prefect.transactions import transaction
@task
def first_task():
print('first')
@first_task.on_rollback
def roll(txn):
print('rolling back')
@task
def second_task():
raise RuntimeError("oopsie")
@flow
def txn_flow():
with transaction():
first_task()
second_task()
if __name__ == "__main__":
txn_flow()
Trigger actions, such as sending notifications, pausing schedules, starting flow runs and more in response to Prefect events.
Variables can now be any JSON compatible type including dicts, lists, and integers. Progress and Image artifacts make it easy to add visual annotations to your flow run graph.
Improved CLI speed and several added commands and conveniences.
The new Runs page displays both flow and task run information, and an improved sidebar and switcher makes navigating Prefect simpler than ever.
3.0.0rc1
deferred
kwarg to Task.map
to executed mapped tasks on a task server by @desertaxle in https://github.com/PrefectHQ/prefect/pull/13756
version
command by @pleek91 in https://github.com/PrefectHQ/prefect/pull/13715
Variable.set
return value + docs by @jakekaplan in https://github.com/PrefectHQ/prefect/pull/13557
PrefectDistributedFuture
to use an event websocket to determine task completion by @desertaxle in https://github.com/PrefectHQ/prefect/pull/13763
prefect-kubernetes
to pydantic 2 by @zzstoatzz in https://github.com/PrefectHQ/prefect/pull/13687
prefect-redis
to integrations by @bunchesofdonald in https://github.com/PrefectHQ/prefect/pull/13758
AwsCredentials
first to match default factory by @bunchesofdonald in https://github.com/PrefectHQ/prefect/pull/13819
load_flow_argument_from_entrypoint
to work with async flows by @elisalimli in https://github.com/PrefectHQ/prefect/pull/13716
str
by @zzstoatzz in https://github.com/PrefectHQ/prefect/pull/13782
retry_delay_seconds
in task engine by @zzstoatzz in https://github.com/PrefectHQ/prefect/pull/13815
RedisFilesystem
to RedisStorageContainer
to match naming semantics of other filesystem classes by @bunchesofdonald in https://github.com/PrefectHQ/prefect/pull/13771
agents
concept page and refs for 3.0 by @serinamarie in https://github.com/PrefectHQ/prefect/pull/13631
Full Changelog: https://github.com/PrefectHQ/prefect/compare/3.0.0rc1...3.0.0rc2
Published by desertaxle 5 months ago
Could not find flow '[...]' in '[...].py'
errors when using prefect deploy
to deploy async flows - https://github.com/PrefectHQ/prefect/pull/13769
prefect deploy
- https://github.com/PrefectHQ/prefect/pull/13778
prefect deploy
- https://github.com/PrefectHQ/prefect/pull/13781
All changes: https://github.com/PrefectHQ/prefect/compare/2.19.3...2.19.4
Published by zangell44 5 months ago
We're excited to announce the release candidate of Prefect 3.0. It's the most flexible, powerful, fastest version of Prefect yet. Prefect 3.0 includes several exciting new features. Install it by running pip install prefect==3.0.0rc1
and check out the docs here.
You can now run and serve tasks outside of flows and inside of other tasks.
from prefect import task
@task
def my_background_task(name: str):
print(f"Hello, {name}!")
if __name__ == "__main__":
my_background_task.delay("ford")
Use rollback and commit hooks to facilitate idempotent python code.
from prefect import flow, task
from prefect.transactions import transaction
@task
def first_task():
print('first')
@first_task.on_rollback
def roll(txn):
print('rolling back')
@task
def second_task():
raise RuntimeError("oopsie")
@flow
def txn_flow():
with transaction():
first_task()
second_task()
if __name__ == "__main__":
txn_flow()
Trigger actions, such as sending notifications, pausing schedules, starting flow runs and more in response to Prefect events.
Variables can now be any JSON compatible type including dicts, lists, and integers. Progress and Image artifacts make it easy to add visual annotations to your flow run graph.
Improved CLI speed and several added commands and conveniences.
The new Runs page displays both flow and task run information, and an improved sidebar and switcher makes navigating Prefect simpler than ever.
task_run.expected_start_time
— https://github.com/PrefectHQ/prefect/pull/13491
enforce_parameter_schema
from False
to True
— https://github.com/PrefectHQ/prefect/pull/13594
PREFECT_EXPERIMENTAL_ENABLE_WORK_POOLS
and PREFECT_EXPERIMENTAL_WARN_WORK_POOLS
— https://github.com/PrefectHQ/prefect/pull/13144
pydantic>=2.7
for Secret
— https://github.com/PrefectHQ/prefect/pull/13613
Duration
types with plain timedelta
s — https://github.com/PrefectHQ/prefect/pull/13603
prefect.yaml
and cli support for new schedule fields — https://github.com/PrefectHQ/prefect/pull/13318
index.md
— https://github.com/PrefectHQ/prefect/pull/13353
deployments-block-based
concept page and refs for 3.0 — https://github.com/PrefectHQ/prefect/pull/13626
infrastructure
concept page and refs for 3.0 — https://github.com/PrefectHQ/prefect/pull/13629
prefect.software
from docs — https://github.com/PrefectHQ/prefect/pull/13382
host.md
— https://github.com/PrefectHQ/prefect/pull/13351
storage
concept page and refs - https://github.com/PrefectHQ/prefect/pull/13630
prefect-dbt
to pydantic v2 - https://github.com/PrefectHQ/prefect/pull/13718
prefect-email
to pydantic v2 — https://github.com/PrefectHQ/prefect/pull/13654
prefect-slack
to pydantic v2 — https://github.com/PrefectHQ/prefect/pull/13673
prefect-shell
to pydantic v2 — https://github.com/PrefectHQ/prefect/pull/13675
prefect-gcp
to pydantic v2 — https://github.com/PrefectHQ/prefect/pull/13650
prefect-github
to pydantic v2 — https://github.com/PrefectHQ/prefect/pull/13655
prefect-gitlab
to pydantic v2 — https://github.com/PrefectHQ/prefect/pull/13656
prefect-docker
to pydantic v2 - https://github.com/PrefectHQ/prefect/pull/13697
prefect-sqlalchemy
to pydantic v2 - https://github.com/PrefectHQ/prefect/pull/13700
PrefectDistributedClient
to prefect-dask
— https://github.com/PrefectHQ/prefect/pull/13537
RayTaskRunner
for compatibility with new engine — https://github.com/PrefectHQ/prefect/pull/13575
DaskTaskRunner
for compatibility with the updated engine — https://github.com/PrefectHQ/prefect/pull/13555
prefect deployment build
CLI from main
— https://github.com/PrefectHQ/prefect/pull/13366
prefect agent
CLI from main
— https://github.com/PrefectHQ/prefect/pull/13365
prefect deployment apply
CLI from main
— https://github.com/PrefectHQ/prefect/pull/13367
PrefectAgent
class — https://github.com/PrefectHQ/prefect/pull/13374
prefect.software
— https://github.com/PrefectHQ/prefect/pull/13375
deployments
module — https://github.com/PrefectHQ/prefect/pull/13373
EcsTask
from main
— https://github.com/PrefectHQ/prefect/pull/13417
AzureContainerInstanceJob
from main
— https://github.com/PrefectHQ/prefect/pull/13418
VertexAICustomTrainingJob
from main
— https://github.com/PrefectHQ/prefect/pull/13419
CloudRunJob
from main
— https://github.com/PrefectHQ/prefect/pull/13420
main
— https://github.com/PrefectHQ/prefect/pull/13424
Infrastructure
, BlockWorker
from main
— https://github.com/PrefectHQ/prefect/pull/13430
main
— https://github.com/PrefectHQ/prefect/pull/13410
prefect-agent
as a possible work pool type — https://github.com/PrefectHQ/prefect/pull/13444
deprecated
module and its references — https://github.com/PrefectHQ/prefect/pull/13345
is_state
— https://github.com/PrefectHQ/prefect/pull/13569
prefect work-queue
and refs to agents - https://github.com/PrefectHQ/prefect/pull/13638
All changes: https://github.com/PrefectHQ/prefect/compare/2.19.0...3.0.0rc1
See release notes for details.
Published by abrookins 5 months ago
prefect deploy
now works even when dependencies are missing from the current environment. This can speed up deployment via CI by removing the need to install dependencies before deploying your flows.
See the following pull requests for implementation details:
All changes: https://github.com/PrefectHQ/prefect/compare/2.19.2...2.19.3
Published by serinamarie 5 months ago
This release includes a few bug fixes, ensuring:
deployments/{id}/create_flow_run
endpoint hydrates workspace variablesrequests
dependency pinned to <2.32.0
in requirements-dev.txt
- https://github.com/PrefectHQ/prefect/pull/13538
Published by desertaxle 5 months ago
prefect-dbt
for running dbt-core
commandsIntroducing prefect-dbt
summary artifacts! With summary artifacts, you get a view of all of the runs that succeeded, failed, or were skipped as well as where the failed models live in your dbt project and why they failed. This exposes information about each dbt node in a succinct format that teams can use for development, debugging, insights, and so much more.
These changes are available in prefect-dbt
version 0.5.0!
See the following pull requests for implementation details:
prefect-ray
- https://github.com/PrefectHQ/prefect/pull/13385
prefect<3.0.0
- https://github.com/PrefectHQ/prefect/pull/13408
This release was accompanied by the following integration library releases:
prefect-aws
- 0.4.17prefect-azure
- 0.3.10prefect-bitbucket
- 0.2.5prefect-dask
- 0.2.9prefect-databricks
- 0.2.7prefect-dbt
- 0.5.0prefect-docker
- 0.5.2prefect-email
- 0.3.5prefect-gcp
- 0.5.12prefect-github
- 0.2.5prefect-gitlab
- 0.2.5prefect-kubernetes
- 0.3.10prefect-ray
- 0.3.6prefect-shell
- 0.2.5prefect-slack
- 0.2.6prefect-snowflake
- 0.27.6prefect-sqlalchemy
- 0.4.3All changes: https://github.com/PrefectHQ/prefect/compare/2.19.0...2.19.1
Published by serinamarie 5 months ago
✨ This release includes a number of enhancements and fixes!
As prefect-dask
and other integrations have been added to the prefect codebase, this release adds these integrations as extra requirements of the prefect package, making it easier to install support for everything in your Prefect stack:
pip install 'prefect[dask]'
We loved this community contribution so much, we did it for all our first-party integrations:
pip install 'prefect[aws,kubernetes,dask,dbt,sqlalchemy,slack]'
You can see the full list of Prefect's extra requirements in our setup.py.
You may want to fail immediately if a global concurrency slot is unavailable. Rather than block and wait, you can now specify a timeout_seconds
argument in the global concurrency context manager and catch a TimeoutError
if a slot is not available within the specified time.
@flow
def fail_immediately_flow():
try:
with concurrency("there-can-be-only-one", occupy=1, timeout_seconds=0.1):
do_something_resource_intensive()
except TimeoutError:
return Cancelled(message="Another flow run is already running")
Global concurrency limits let you control how many operations can run simultaneously-- now you can create, read, edit, and delete global concurrency limits via the Prefect CLI!
To create a new concurrency limit, use the prefect gcl create
command. You must specify a --limit
argument, and can optionally specify a --slot-decay-per-second
and --disable
argument.
prefect gcl create my-concurrency-limit --limit 5 --slot-decay-per-second 1.0
You can inspect the details of a concurrency limit using the prefect gcl inspect
command:
prefect gcl inspect my-concurrency-limit
To update a concurrency limit, use the prefect gcl update
command. You can update the --limit
, --slot-decay-per-second
, --enable
, and --disable
arguments:
prefect gcl update my-concurrency-limit --limit 10
We also have many more bug fixes and in-flight work! See the release notes for details!
Published by pleek91 6 months ago
All changes: https://github.com/PrefectHQ/prefect/compare/2.18.2...2.18.3
Published by serinamarie 6 months ago
flow.serve
is now optionalWhen running flow.serve
, you can now omit the deployment name. If you do not provide a deployment name, the deployment name will default to the name of the flow. This change makes it easier to run flows without needing to specify a deployment name each time:
@flow
def etl_flow():
pass
if __name__ == "__main__":
etl_flow.serve()
results in:
Your flow 'etl-flow' is being served and polling for scheduled runs!
To trigger a run for this flow, use the following command:
$ prefect deployment run 'etl-flow/etl-flow'
🛠✨ We've also released a few important fixes to our deployment parameter form when creating a run in the Prefect UI! 🧑🎨
🚀 This release also includes a number of other fixes and in-flight feature work. See the release notes for more details!
Published by bunchesofdonald 6 months ago
prefect deploy
— https://github.com/PrefectHQ/prefect/pull/12833
validationUpdate
schema where definitions are falsy — https://github.com/PrefectHQ/prefect/pull/12880
prefect cloud login
to override current workspace — https://github.com/PrefectHQ/prefect/pull/12867
prefect deployment run --watch
— https://github.com/PrefectHQ/prefect/pull/12894
flow.serve
and .deploy
— https://github.com/PrefectHQ/prefect/pull/12789
PrefectCloudEventSubscriber
via CLI — https://github.com/PrefectHQ/prefect/pull/12796
prefect automation delete
CLI — https://github.com/PrefectHQ/prefect/pull/12876
prefect-azure
docs to Integrations section of the Prefect docs — https://github.com/PrefectHQ/prefect/pull/12794
server
import recommendations — https://github.com/PrefectHQ/prefect/pull/12823
FormattedDate
component to display accessible, long-form timestamps consistentlynull
(None
) — https://github.com/PrefectHQ/prefect-ui-library/pull/2323
vpc
isn't in job template — https://github.com/PrefectHQ/prefect-gcp/pull/267
Published by abrookins 6 months ago
deployment.yaml
in prefect deploy
— https://github.com/PrefectHQ/prefect/pull/12731
-f/--flow
as option to prefect deploy
— https://github.com/PrefectHQ/prefect/pull/12732
projects
from prefect deploy
— https://github.com/PrefectHQ/prefect/pull/12737
--ci
option from prefect deploy
— https://github.com/PrefectHQ/prefect/pull/12740
prefect cloud login
and workspace set
— https://github.com/PrefectHQ/prefect/pull/12717
Full Changelog: https://github.com/PrefectHQ/prefect/compare/2.17.0...2.18.0
See the release notes for more!
Published by desertaxle 6 months ago
opentelemetry
import — https://github.com/PrefectHQ/prefect/pull/12684
All changes: https://github.com/PrefectHQ/prefect/compare/2.17.0...2.17.1
Published by desertaxle 6 months ago
Prefect variables are useful for storing and reusing data and configuration between and across workflows; and previously you could only create and update variables via the Prefect UI. With this release, you can now get and set Prefect variables directly in your Python code with the new Variable.set
and Variable.get
methods!
For an example of reading and writing variable values in Python see the following example:
from prefect.variables import Variable
# set a variable
variable = Variable.set(name="the_answer", value="42")
# get a variable
answer = Variable.get('the_answer')
print(answer.value)
# 42
# get a variable with a default value
answer = Variable.get('not_the_answer', default='42')
print(answer.value)
# 42
# update a variable
answer = Variable.set(name="the_answer", value="43", overwrite=True)
print(answer.value)
#43
Refer to the docs for more information and see the PR for implementation details: https://github.com/PrefectHQ/prefect/pull/12596
User-Agent
header containing the running Prefect version — https://github.com/PrefectHQ/prefect/pull/12601
... and numerous 🐛 fixes!
Full Changelog: https://github.com/PrefectHQ/prefect/compare/2.16.9...2.17.0
See the release notes for more!
Published by serinamarie 7 months ago
This release includes a number of enhancements and in-flight feature work.
🛠✨ One such enhancement helps streamline our CLI by adding a -jv/--job-variable
option to prefect deploy
, on par with the option available in prefect deployment run
.
🔄🔗 In terms of enhancing existing Prefect concepts, we've removed a constraint that prevented tasks from being called from other tasks. For example, this allows you to call tasks within tasks within a flow.
🗿 📉 We no longer create artifacts for unpersisted results, which should prevent an influx of entries to the artifact
table. Retried flows without persisted results will now have an error message stating that the "State data is missing" rather than referencing an "unpersisted result".
See the release notes for more details!
Published by bunchesofdonald 7 months ago
Published by zzstoatzz 7 months ago
prefect shell
for observing CLI commandsYou can now observe CLI commands as a Prefect flow. For example:
» prefect shell watch "curl http://wttr.in/Chicago?format=3"
17:32:39.562 | INFO | prefect.engine - Created flow run 'powerful-mushroom' for flow 'Shell Command'
17:32:40.171 | INFO | Flow run 'powerful-mushroom' - Chicago: ⛅️ +50°F
17:32:40.315 | INFO | Flow run 'powerful-mushroom' - Finished in state Completed()
See these docs to learn how to:
watch
serve
See the PR for implementation details: https://github.com/PrefectHQ/prefect/pull/11998
DeploymentTrigger
YAML representation — https://github.com/PrefectHQ/prefect/pull/12413
... and numerous 🐛 fixes!
Full Changelog: https://github.com/PrefectHQ/prefect/compare/2.16.6...2.16.7
See the release notes for more!
Published by zzstoatzz 7 months ago
typer 0.10.0
that broke the prefect
CLISee the following pull request for implementation details:
typer.Option
behavior — https://github.com/PrefectHQ/prefect/pull/12398
All changes: https://github.com/PrefectHQ/prefect/compare/2.16.5...2.16.6
Published by abrookins 7 months ago
It is now easier to bulk select and delete flow runs through the UI. Listings of filterable and selectable flow runs (e.g. on the flow runs, flow, and deployment pages) now include a top-level checkbox for (de)selecting all currently filtered flow runs for bulk deletion.
See the following pull request for implementation details:
Additionally, the flow run graph UI enhancements for visualizing state changes and artifacts added in 2.16.4 are now enabled by default. See the release notes in 2.16.4 for more details!
Full Changelog: https://github.com/PrefectHQ/prefect/compare/2.16.4...2.16.5
See the release notes for more!
Published by zhen0 7 months ago
The Flow Run Graph has been updated to display additional layers of information! Interactive and real-time state changes and artifacts are now visible in context on the graph.
A year ago, we released workers as a replacement for agents. Workers significantly enhance the experience of deploying flows and simplify the specification of each flow's infrastructure and runtime environment.
With this release we are adding a six month (September 14) deprecation warning to agents and related concepts. Please note that:
Like agents, workers support creating deployments through the Prefect CLI and through Python, but require different syntax. For more information, please refer to the Upgrade from Agents to Workers guide.
#2190
#139
build_from_flow
- https://github.com/PrefectHQ/prefect/pull/12257
prefect deployment run
- https://github.com/PrefectHQ/prefect/pull/12267
#2216
#392
serve
method on tasks - https://github.com/PrefectHQ/prefect/pull/12239
PrefectAgent
and prefect agent
command group - https://github.com/PrefectHQ/prefect/pull/12273
Deployment
class and deployment build
and apply
commands - https://github.com/PrefectHQ/prefect/pull/12283
packaging
module - https://github.com/PrefectHQ/prefect/pull/12291
default-agent-pool
in empty state server - https://github.com/PrefectHQ/prefect/pull/12214
get_run_logger
to imports in interactive workflow examples - https://github.com/PrefectHQ/prefect/pull/12284
on_running
state change hook to State -> Concepts docs - https://github.com/PrefectHQ/prefect/pull/12293
Full Changelog: https://github.com/PrefectHQ/prefect/compare/2.16.3...2.16.4
Published by serinamarie 8 months ago
This release includes enhanced deployment parameters in the Prefect UI. We’ve refined the deployment parameters UI to significantly enhance default value handling and list management. 🛠️ This release introduces support for tuple-type parameters and a revamped list UI, freeing users from the constraints of JSON for list inputs. 🔄 You now have the flexibility to utilize JSON or Prefect variables for any parameter value, enhancing the versatility of deployment configurations. 💪 Moreover, we’ve synchronized validation across the UI and deployment schemas, ensuring that user inputs are consistently checked against the defined parameter requirements, which simplifies the deployment process and minimizes configuration errors. ✅ These improvements are aimed at providing a more efficient and user-friendly interface for managing deployment parameters. 🌟
This release also includes many other enhancements and fixes, including a new on_running
state change hook 🎣, two memory leak fixes 🔧, and much more.
See the release notes for details! 📜🚀