Prefect is a workflow orchestration tool empowering developers to build, observe, and react to data pipelines
APACHE-2.0 License
Bot releases are visible (Hide)
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! ๐๐
Published by zzstoatzz 8 months ago
2.16.1
In 2.16.1
, a regression related to logging non-str
objects (when a PREFECT_API_KEY
was set) was introduced. The fix is included in 2.16.2
.
See https://github.com/PrefectHQ/prefect/pull/12151 for implementation details.
.serve
or .deploy
from prefect_dbt.cloud.jobs import trigger_dbt_cloud_job_run_and_wait_for_completion
from prefect.deployments import EntrypointType
if __name__ == "__main__":
trigger_dbt_cloud_job_run_and_wait_for_completion.deploy(
name="demo-deploy-from-module",
work_pool_name="olympic",
entrypoint_type=EntrypointType.MODULE_PATH,
job_variables={"env": { "EXTRA_PIP_PACKAGES": "prefect-dbt" } }
)
See https://github.com/PrefectHQ/prefect/pull/12134 for implementation details.
Full Changelog: https://github.com/PrefectHQ/prefect/compare/2.16.1...2.16.2
See the release notes for more!
Published by zzstoatzz 8 months ago
prefect.yaml
now supports specifying multiple schedules via the schedules
key.
This allows you to define multiple schedules for a single deployment, and each schedule can have its own cron
, interval
, or rrule
configuration:
...
schedules:
- cron: "0 0 * * *"
active: false
- interval: 3600
active: true
- rrule: "FREQ=YEARLY"
active: true
In addition you can specify multiple schedules via arguments to prefect deploy
:
prefect deploy ... --cron '4 * * * *' --cron '1 * * * *' --rrule 'FREQ=DAILY'
We've also added support for multiple schedules to flow.serve
, flow.deploy
and prefect.runner.serve
. You can provide multiple schedules by passing a list to the cron
, interval
, or rrule
arguments:
import datetime
import random
from prefect import flow
@flow
def trees():
tree = random.choice(["๐ณ", "๐ด", "๐ฒ", "๐ต"])
print(f"Here's a happy little tree: {tree}")
if __name__ == "__main__":
trees.serve(
name="trees",
interval=[3600, 7200, 14400],
)
This will create a deployment with three schedules, one that runs every hour, one that runs every two hours, and one that runs every four hours. For more advanced cases, use the schedules
argument.
trees.serve(
name="trees",
schedules=[
IntervalSchedule(interval=datetime.timedelta(minutes=30)),
{"schedule": RRuleSchedule(rrule="FREQ=YEARLY"), "active": True},
MinimalDeploymentSchedule(schedule=CronSchedule(cron="0 0 * * *"), active=False),
]
)
Dive into these new scheduling capabilities today and streamline your workflows like never before.
For implementation details, see the following pull request:
- https://github.com/PrefectHQ/prefect/pull/12107
See the release notes for more details!
Published by abrookins 8 months ago
With todayโs release, weโre excited to roll out initial support for using multiple schedules with Deployments! You can now use multiple schedules in the following ways:
Deployment
classprefect deployment schedule <create, delete, pause, resume, ls, clear>
Coming soon, weโll round out support for multiple schedules in other areas, such as:
flow.serve()
and flow.deploy()
prefect deploy
The easiest way to get started with multiple schedules is to try out the new CLI commands:
$ prefect deployment schedule ls happy-flow/my-deployment
Deployment Schedules
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโณโโโโโโโโโ
โ ID โ Schedule โ Active โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ c7d3ddc4-9a5a-4dec-bd59-eed282ae55d5 โ cron: 0 0 1 * 1 โ True โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโดโโโโโโโโโ
$ prefect deployment schedule create happy-flow/my-deployment --interval 60
Created deployment schedule!
$ prefect deployment schedule ls happy-flow/my-deployment
Deployment Schedules
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโ
โ ID โ Schedule โ Active โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ 3638ed58-cab2-4462-a680-2f92fcf6c797 โ interval: 0:01:00s โ True โ
โ c7d3ddc4-9a5a-4dec-bd59-eed282ae55d5 โ cron: 0 0 1 * 1 โ True โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโ
flow.deploy
and deploy
โ https://github.com/PrefectHQ/prefect/pull/12017
deployment run --help
so it renders for more args โ https://github.com/PrefectHQ/prefect/pull/11960
Flow.with_options
logic for retries, retry_delay_seconds, flow_run_name โ https://github.com/PrefectHQ/prefect/pull/12020
wait_for_flow_run
โ https://github.com/PrefectHQ/prefect/pull/11999
Task.submit()
for autonomous task submission โ https://github.com/PrefectHQ/prefect/pull/12025
Full release notes: https://github.com/PrefectHQ/prefect/blob/main/RELEASE-NOTES.md
Published by desertaxle 8 months ago
We are excited to announce that task runs are now executed on the main thread!
When feasible, task runs are now executed on the main thread instead of a worker thread. Previously, all task runs were run in a new worker thread. This allows objects to be passed to and from tasks without worrying about thread safety unless you have opted into concurrency. For example, an HTTP client or database connection can be shared between a flow and its tasks now (unless synchronous concurrency is used). Some asynchronous and sequential use cases may see performance improvements.
Consider the following example:
import sqlite3
from prefect import flow, task
db = sqlite3.connect("threads.db")
try:
db.execute("CREATE TABLE fellowship(name)")
except sqlite3.OperationalError:
pass
else:
db.commit()
db.execute("DELETE FROM fellowship")
db.commit()
cur = db.cursor()
@task
def my_task(name: str):
global db, cur
cur.execute('INSERT INTO fellowship VALUES (?)', (name,))
db.commit()
@flow
def my_flow():
global db, cur
for name in ["Frodo", "Gandalf", "Gimli", "Aragorn", "Legolas", "Boromir", "Samwise", "Pippin", "Merry"]:
my_task(name)
print(cur.execute("SELECT * FROM fellowship").fetchall())
db.close()
if __name__ == "__main__":
my_flow()
In previous versions of Prefect, running this example would result in an error like this:
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 7977619456 and this is thread id 6243151872.
But now, with task runs executing on the main thread, this example will run without error! We're excited this change makes Prefect even more intuitive and flexible!
See the following pull request for implementation details:
- https://github.com/PrefectHQ/prefect/pull/11930
You can monitor the status of a flow run created from a deployment via the CLI. This is useful for observing a flow run's progress without navigating to the UI.
To monitor a flow run started from a deployment, use the --watch
option with prefect deployment run
:
prefect deployment run --watch <slugified-flow-name>/<slugified-deployment-name>
See the following pull request for implementation details:
- https://github.com/PrefectHQ/prefect/pull/11702
starlette
version to resolve vulnerability in python-mulipart
โ https://github.com/PrefectHQ/prefect/pull/11956
RUNNING
-> RUNNING
state transitions for autonomous task runs โ https://github.com/PrefectHQ/prefect/pull/11975
PENDING
state for autonomous task execution โ https://github.com/PrefectHQ/prefect/pull/11985
run_deployment
tags parameter documentation โ https://github.com/PrefectHQ/prefect/pull/11955
All changes: https://github.com/PrefectHQ/prefect/compare/2.14.21...2.15.0
Published by zangell44 8 months ago
We're excited to unveil the new status indicators for work queues in Prefect's UI, enhancing your ability to oversee and control flow run execution within our hybrid work pools.
Work queues will now display one of three distinct statuses:
Ready
- one or more online workers are actively polling the work queueNot Ready
- no online workers are polling the work queue, signaling a need for interventionPaused
- the work queue is intentionally paused, preventing executionWith the introduction of work queue status, you'll notice the absence of deprecated work queue health indicators in the UI.
See the documentation on work queue status for more information.
For now, this is an experimental feature, and can be enabled by running:
prefect config set PREFECT_EXPERIMENTAL_ENABLE_WORK_QUEUE_STATUS=True
See the following pull request for implementation details:
- https://github.com/PrefectHQ/prefect/pull/11829
WARNING
level log indicating a task run completed successfully โ https://github.com/PrefectHQ/prefect/pull/11810
deployments
section of a prefect.yaml
file were not resolved correctly โ https://github.com/PrefectHQ/prefect/pull/11740
pool_pre_ping
to improve stability for long-lived PostgreSQL connections โ https://github.com/PrefectHQ/prefect/pull/11911
All changes: https://github.com/PrefectHQ/prefect/compare/2.14.20...2.14.21
Published by collincchoy 9 months ago
All changes: https://github.com/PrefectHQ/prefect/compare/2.14.19...2.14.20
Published by bunchesofdonald 9 months ago
You can now include dynamic, markdown-formatted descriptions when pausing or suspending a flow run for human input. This description will be shown in the Prefect UI alongside the form when a user is resuming the flow run, enabling developers to give context and instructions to users when they need to provide input.
from datetime import datetime
from prefect import flow, pause_flow_run, get_run_logger
from prefect.input import RunInput
class UserInput(RunInput):
name: str
age: int
@flow
async def greet_user():
logger = get_run_logger()
current_date = datetime.now().strftime("%B %d, %Y")
description_md = f"""
**Welcome to the User Greeting Flow!**
Today's Date: {current_date}
Please enter your details below:
- **Name**: What should we call you?
- **Age**: Just a number, nothing more.
"""
user_input = await pause_flow_run(
wait_for_input=UserInput.with_initial_data(
description=description_md, name="anonymous"
)
)
if user_input.name == "anonymous":
logger.info("Hello, stranger!")
else:
logger.info(f"Hello, {user_input.name}!")
See the following PR for implementation details:
RunInput
saving to include descriptions, improving clarity and documentation for flow inputs โ https://github.com/PrefectHQ/prefect/pull/11776
azure_storage_container
for more flexible storage options โ https://github.com/PrefectHQ/prefect/pull/11784
TaskRunFilterFlowRunId
for both client and server, enhancing task run filtering capabilities โ https://github.com/PrefectHQ/prefect/pull/11748