Prefect

Latest version: v3.1.4

Safety actively analyzes 681748 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 21 of 59

2.14.16

Not secure
๐ŸŽ‰ Support for access block fields in `prefect.yaml` templating

You can now access fields on blocks used in your `prefect.yaml` files. This enables you to use values stored in blocks to provide dynamic configuration for attributes like your `work_pool_name` and `job_variables`.

Here's what it looks like in action:

yaml
deployments:
- name: test
version: 0.1
tags: []
description: "Example flow"
schedule: {}
entrypoint: "flow.py:example_flow"
parameters: {}
work_pool:
name: "{{ prefect.blocks.json.default-config.value.work_pool }}"
work_queue: "{{ prefect.blocks.json.default-config.value.work_queue }}"


In the above example, we use fields from a `JSON` block to configure which work pool and queue we deploy our flow to. We can update where our flow is deployed to by updating the referenced block without needing to change our `prefect.yaml` at all!

Many thanks to bjarneschroeder for contributing this functionality! Check out this PR for implementation details: https://github.com/PrefectHQ/prefect/pull/10938


๐Ÿ‘๐Ÿผ Enhancements
- Add the `wait_for_flow_run` method to `PrefectClient` to allow waiting for a flow run to complete โ€” https://github.com/PrefectHQ/prefect/pull/11305
- Add a provisioner for `Modal` push work pools โ€” https://github.com/PrefectHQ/prefect/pull/11665
- Expose the `limit` kwarg in `serve` to increase its visibility โ€” https://github.com/PrefectHQ/prefect/pull/11645
- Add methods supporting modification and suppression of flow run notification policies โ€” https://github.com/PrefectHQ/prefect/pull/11163
- Enhancements to sending and receiving flow run inputs by automatically converting types to `RunInput` subclasses โ€” https://github.com/PrefectHQ/prefect/pull/11636

โ›‘๏ธ Fixes
- Fix block reference resolution in `prefect.yaml` and support accessing block fields using keypaths โ€” https://github.com/PrefectHQ/prefect/pull/10938
- Avoid rerunning task runs forced to `COMPLETED` state โ€” https://github.com/PrefectHQ/prefect/pull/11385
- Add a new UI setting to customize the served static directory โ€” https://github.com/PrefectHQ/prefect/pull/11648

โœ๏ธ Documentation
- Fix retry handler example code in task concept docs โ€” https://github.com/PrefectHQ/prefect/pull/11633
- Fix docstring example in `from_source` โ€” https://github.com/PrefectHQ/prefect/pull/11634
- Add an active incident screenshot to the documentation โ€” https://github.com/PrefectHQ/prefect/pull/11647
- Add clarification on work queues being a feature of hybrid work pools only โ€” https://github.com/PrefectHQ/prefect/pull/11651
- Update interactive workflow guide description and heading โ€” https://github.com/PrefectHQ/prefect/pull/11663
- Add API reference documentation for `wait_for_flow_run` โ€” https://github.com/PrefectHQ/prefect/pull/11668
- Remove duplicate line in `prefect deploy` docs โ€” https://github.com/PrefectHQ/prefect/pull/11644
- Update README to clearly mention running the Python file before starting server โ€” https://github.com/PrefectHQ/prefect/pull/11643
- Fix typo in `Modal` infrastructure documentation โ€” https://github.com/PrefectHQ/prefect/pull/11676

๐Ÿฅ‡ New Contributors
* N-Demir made their first contribution in https://github.com/PrefectHQ/prefect/pull/11633
* sgbaird made their first contribution in https://github.com/PrefectHQ/prefect/pull/11644
* bjarneschroeder made their first contribution in https://github.com/PrefectHQ/prefect/pull/10938
* Fizzizist made their first contribution in https://github.com/PrefectHQ/prefect/pull/11305
* NeodarZ made their first contribution in https://github.com/PrefectHQ/prefect/pull/11163

2.14.15

Not secure
What's Changed
Hotfix
* Bugfix: Missing `UI_SERVE_BASE_URL` lead to incorrect asset urls by znicholasbrown in https://github.com/PrefectHQ/prefect/pull/11628


**Full Changelog**: https://github.com/PrefectHQ/prefect/compare/2.14.14...2.14.15

2.14.14

Not secure
โœจ Support for custom prefect.yaml deployment configuration files

You can now specify a `prefect.yaml` deployment configuration file while running `prefect deploy` by using the
`--prefect-file` command line argument. This means that your configuration files can be in any directory
and can follow your own naming conventions. Using this feature provides more flexibility in defining
and managing your deployments.

โœ… Toggle Deployment Schedule Status via `prefect.yaml`

You can now toggle your deployment schedules between `active` and `inactive` in your `prefect.yaml` configuration file. This enables you to create deployments with initially _inactive_ schedules, allowing for thorough testing or staged rollouts!

๐Ÿ Support for Python 3.12

You can now install `prefect` using Python 3.12! This support is experimental and will be hardened in future releases.

๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘ Contributors
A big thanks to brett-koonce, jitvimol, oz-elhassid, Zyntogz, and Andrew-S-Rosen for making their first contributions in this release.

See the [release notes](https://github.com/PrefectHQ/prefect/blob/main/RELEASE-NOTES.md#release-21414) for more details.

2.14.13

Not secure
This release includes a few very exciting enhancements! ๐Ÿช„

Access default work pool configurations in an air-gapped environment ๐ŸŒ
Those who run Prefect server in an environment where arbitrary outbound internet traffic is not allowed were previously unable to retrieve up-to-date default work pool configurations (via the UI or otherwise). You can now access the worker metadata needed to access the corresponding work pool configurations in your server even in such an air-gapped environment. Upon each release of `prefect`, the most recent version of this worker metadata will be embedded in the `prefect` package so that it can be used as a fallback if the outbound call to retrieve the real-time metadata fails.

Introducing conditional task retries for enhanced workflow control ๐Ÿ”
In this release, we're excited to introduce the ability to conditionally retry tasks by passing in an argument to `retry_condition_fn` in your task decorator, enabling more nuanced and flexible retry mechanisms. This adds a significant level of control and efficiency, particularly in handling complex or unpredictable task outcomes. For more information on usage, check out our [docs](https://docs.prefect.io/latest/concepts/tasks/#custom-retry-behavior)!

Other enhancements and fixes ๐Ÿ› ๏ธ
We've also added the ability to open your current Prefect Cloud workspace in the browser from the CLI, display work queue status details via CLI, and much more! See the [release notes](https://github.com/PrefectHQ/prefect/blob/main/RELEASE-NOTES.md#release-21413) for details.

Contributors ๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘
A big thanks to dominictarro and ConstantinoSchillebeeckx for contributing enhancements to this release, as well as to yifanmai, who made their first contribution.

2.14.12

Not secure
This release brings some exciting enhancements and fixes!

Enhanced UI Customization ๐Ÿ“†

- Now featuring relative time spans like "Past 7 days" for better insight into current and upcoming flow runs across the UI.
- Flow Runs Page: Enhanced with customizable date and time filters. Save custom filters with specific date ranges for tailored views
- Flows Page: Updated with similar date and time filtering capabilities

See a demonstration here!
[![short loom demo](https://github.com/PrefectHQ/prefect/assets/42048900/4dc01ec0-0776-49b4-bbc4-a1472c612e4f)](https://www.loom.com/share/95113969257d4cffa48ad13f943f950f?sid=b20bc27c-0dc2-40be-a627-a2148942c427)

Get type-checked input from humans in the loop

Human-in-the-loop flows just got an upgrade. You can now pause or suspend a flow and wait for type-checked input. To get started, declare the structure of the input data using a Pydantic model, and Prefect will render a form dynamically in the UI when a human resumes the flow. Form validation will ensure that the data conforms to your Pydantic model, and your flow will receive tbe input.

<img width="472" alt="image" src="https://github.com/PrefectHQ/prefect/assets/97182/ac743557-e872-4b48-a61e-c74c95e076f0">

Prefect's new `RunInput` class powers this experience. `RunInput` is a subclass of Pydantic's `BaseModel`. Here's an example of a `RunInput` that uses dates, literals, and nested Pydantic models to show you what's possible:

python
class Person(RunInput):
first_name: str
last_name: str
birthday: datetime.date
likes_tofu: bool
age: int = Field(gt=0, lt=150)
shirt_size: Literal[ShirtSize.SMALL, ShirtSize.MEDIUM, ShirtSize.LARGE,
ShirtSize.XLARGE]
shirt_color: Literal["red", "blue", "green"]
preferred_delivery_time: datetime.datetime
shipping_address: ShippingAddress
billing_address: BillingAddress | SameAsShipping = Field(
title="", default_factory=SameAsShipping
)


Check out our [guide on how to create human-in-the-loop flows](https://docs.prefect.io/latest/guides/creating-human-in-the-loop-workflows/) to learn more!

Enhancements and Fixes ๐Ÿ› ๏ธ
- Fixed environment variable parsing during deployment and prompt and role assignment in the `ContainerInstanceProvisioner`
- Enhanced dashboard header to adapt to various tag and date input sizes
- Addressed an error encountered when deploying flows with options

See the [release notes](https://github.com/PrefectHQ/prefect/blob/main/RELEASE-NOTES.md#release-21412) for details!

2.14.11

Not secure
๐Ÿช„ โœจ Customize resource names when provisioning infrastructure for push work pools

In the past few releases, we've added the ability to provision infrastructure for push work pools via the CLI. This release adds the ability to customize the name of the resources created in your cloud environment when provisioning infrastructure for push work pools so you can follow your organization's naming conventions.

To customize your resource names when provisioning infrastructure for a push work pool, follow the interactive prompts:

bash
? Proceed with infrastructure provisioning with default resource names? [Use arrows to move; enter to select]
โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ โ”ƒ Options: โ”ƒ
โ”กโ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ โ”‚ Yes, proceed with infrastructure provisioning with default resource names โ”‚
โ”‚ > โ”‚ Customize resource names โ”‚
โ”‚ โ”‚ Do not proceed with infrastructure provisioning โ”‚
โ””โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
? Please enter a name for the resource group (prefect-aci-push-pool-rg): new-rg
? Please enter a name for the app registration (prefect-aci-push-pool-app): new-app
? Please enter a prefix for the Azure Container Registry (prefect): newregistry
? Please enter a name for the identity (used for ACR access) (prefect-acr-identity): new-identity
? Please enter a name for the ACI credentials block (new-work-pool-push-pool-credentials): new-aci-block
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ Provisioning infrastructure for your work pool new-work-pool will require: โ”‚
โ”‚ โ”‚
โ”‚ Updates in subscription: Azure subscription 1 โ”‚
โ”‚ โ”‚
โ”‚ - Create a resource group in location: eastus โ”‚
โ”‚ - Create an app registration in Azure AD: new-app โ”‚
โ”‚ - Create/use a service principal for app registration โ”‚
โ”‚ - Generate a secret for app registration โ”‚
โ”‚ - Create an Azure Container Registry with prefix newregistry โ”‚
โ”‚ - Create an identity new-identity to allow access to the created registry โ”‚
โ”‚ - Assign Contributor role to service account โ”‚
โ”‚ - Create an ACR registry for image hosting โ”‚
โ”‚ - Create an identity for Azure Container Instance to allow access to the registry โ”‚
โ”‚ โ”‚
โ”‚ Updates in Prefect workspace โ”‚
โ”‚ โ”‚
โ”‚ - Create Azure Container Instance credentials block: new-aci-block โ”‚
โ”‚ โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
Proceed with infrastructure provisioning? [y/n]: y
Creating resource group
Resource group 'new-rg' created successfully
Creating app registration
App registration 'new-app' created successfully
Generating secret for app registration
Secret generated for app registration with client ID '03923189-3151-4acd-8d59-76483752cd39'
Creating ACI credentials block
ACI credentials block 'new-aci-block' created in Prefect Cloud
Assigning Contributor role to service account
Service principal created for app ID '25329389-3151-4acd-8d59-71835252cd39'
Contributor role assigned to service principal with object ID '483h4c85-4a8f-4fdb-0394-bd0f0b1202d0'
Creating Azure Container Registry
Registry created
Logged into registry newregistry1702538242q2z2.azurecr.io
Creating identity
Identity 'new-identity' created
Provisioning infrastructure. โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 100% 0:00:00
Your default Docker build namespace has been set to 'newregistry1702538242q2z2.azurecr.io'.
Use any image name to build and push to this registry by default:

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ example_deploy_script.py โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ from prefect import flow โ”‚
โ”‚ from prefect.deployments import DeploymentImage โ”‚
โ”‚ โ”‚
โ”‚ โ”‚
โ”‚ flow(log_prints=True) โ”‚
โ”‚ def my_flow(name: str = "world"): โ”‚
โ”‚ print(f"Hello {name}! I'm a flow running on an Azure Container Instance!") โ”‚
โ”‚ โ”‚
โ”‚ โ”‚
โ”‚ if __name__ == "__main__": โ”‚
โ”‚ my_flow.deploy( โ”‚
โ”‚ name="my-deployment", โ”‚
โ”‚ work_pool_name="my-work-pool", โ”‚
โ”‚ image=DeploymentImage( โ”‚
โ”‚ name="my-image:latest", โ”‚
โ”‚ platform="linux/amd64", โ”‚
โ”‚ ) โ”‚
โ”‚ ) โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
Infrastructure successfully provisioned for 'new-work-pool' work pool!
Created work pool 'new-work-pool'!


Using a push work pool with automatic infrastructure provisioning is a great way to get started with a production-level Prefect set up in minutes! Check out our [push work pool guide](https://docs.prefect.io/latest/guides/deployment/push-work-pools/) for step-by-step instructions on how to get started!

See the following pull requests for implementation details:
- https://github.com/PrefectHQ/prefect/pull/11407
- https://github.com/PrefectHQ/prefect/pull/11381
- https://github.com/PrefectHQ/prefect/pull/11412

๐Ÿ“† ๐Ÿ• An updated date time input on the workspace dashboard

We've added a new date and time filter to the workspace dashboard that gives greater control over the dashboard. You can now filter by days, hours, and even minutes. You can also specify a specific date and time range to filter by. You can also go backwards and forwards in time using that time window, for example, you can scroll through by hour.

See it in action!
[![Demo of updated time input in the Prefect UI](https://github.com/PrefectHQ/prefect/assets/40272060/045b144f-35ff-4b32-abcd-74eaf16f181c)
](https://www.loom.com/share/ca099d3792d146d08df6fcd506ff9eb2?sid=70797dda-6dc6-4fe6-bf4a-a9df2a0bf230)

See the following pull requests for implementation details:
- https://github.com/PrefectHQ/prefect-ui-library/pull/1937
- https://github.com/PrefectHQ/prefect-design/pull/1048


๐Ÿ’ฅ Enhancements
- Add the ability to publish `KubernetesJob` blocks as work pools โ€” https://github.com/PrefectHQ/prefect/pull/11347
- Add setting to configure a default Docker namespace for image builds โ€” https://github.com/PrefectHQ/prefect/pull/11378
- Add the ability to provision an ECR repository for ECS push work pools โ€” https://github.com/PrefectHQ/prefect/pull/11382
- Add ability to provision an Artifact Registry repository for Cloud Run push work pools โ€” https://github.com/PrefectHQ/prefect/pull/11399
- Add ability to provision an Azure Container Registry for Azure Container Instance push work pools โ€” https://github.com/PrefectHQ/prefect/pull/11387
- Add support for `is_schedule_active` to `flow.deploy` and `flow.serve` โ€” https://github.com/PrefectHQ/prefect/pull/11375
- Allow users to select relative and fixed date ranges to filter the dashboard โ€” https://github.com/PrefectHQ/prefect/pull/11406
- Add support for arbitrary sink types to `prefect.utilities.processutils.stream_text` โ€” https://github.com/PrefectHQ/prefect/pull/11298
- Update the Prefect UI deployments page to add run activity and separate out the deployment and flow names โ€” https://github.com/PrefectHQ/prefect/pull/11394
- Update Prefect UI workspace dashboard filters to use new date range - https://github.com/PrefectHQ/prefect-ui-library/pull/1937

๐Ÿงฐ Fixes
- Fix bug where a pause state reused an existing state ID โ€” https://github.com/PrefectHQ/prefect/pull/11405

๐Ÿงช Experimental
- Build out API for creating/reading/deleting flow run inputs โ€” https://github.com/PrefectHQ/prefect/pull/11363
- Integrate flow run input and schema/response mechanics into pause/suspend โ€” https://github.com/PrefectHQ/prefect/pull/11376
- Add typing overloads for pause/suspend methods โ€” https://github.com/PrefectHQ/prefect/pull/11403
- Use bytes for `value` in `create_flow_run_input` โ€” https://github.com/PrefectHQ/prefect/pull/11421
- Validate run input when resuming flow runs โ€” https://github.com/PrefectHQ/prefect/pull/11396
- Run existing deployments via the `Runner` webserver โ€” https://github.com/PrefectHQ/prefect/pull/11333

๐Ÿง  Documentation
- Add instructions for automatic infrastructure provisioning to the push work pools guide โ€” https://github.com/PrefectHQ/prefect/pull/11316
- Fix broken links in states concept doc and daemonize guide โ€” https://github.com/PrefectHQ/prefect/pull/11374
- Update agent upgrade guide to include `flow.deploy` and examples โ€” https://github.com/PrefectHQ/prefect/pull/11373
- Update block document names in Moving Data guide โ€” https://github.com/PrefectHQ/prefect/pull/11386
- Rename `Guides` to` How-to Guides` โ€” https://github.com/PrefectHQ/prefect/pull/11388
- Add guide to provision infrastructure for existing push work pools โ€” https://github.com/PrefectHQ/prefect/pull/11365
- Add documentation for required permissions for infrastructure provisioning โ€” https://github.com/PrefectHQ/prefect/pull/11417
- Add docs for managed execution open beta โ€” https://github.com/PrefectHQ/prefect/pull/11397, https://github.com/PrefectHQ/prefect/pull/11426, and https://github.com/PrefectHQ/prefect/pull/11425

Page 21 of 59

Links

Releases

Has known vulnerabilities

ยฉ 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.