Skip to content

Commit

Permalink
Rename links to examples and add 'uv run' instructions (#17145)
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-prefect authored Feb 19, 2025
1 parent 2e21fae commit 1cf5ee6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/v3/examples/flows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ These examples are sourced from the [PrefectHQ/examples](https://github.com/Pref
|---------|-------------|
| [hello_world.py](https://github.com/PrefectHQ/examples/blob/main/flows/hello_world.py) | A simple "Hello World" flow demonstrating basic flow creation and execution. |
| [access_run_context.py](https://github.com/PrefectHQ/examples/blob/main/flows/access_run_context.py) | Shows how to access and use flow run context information within flows and tasks. |
| [conditionally_retry_with_delay.py](https://github.com/PrefectHQ/examples/blob/main/flows/conditionally_retry_with_delay.py) | Shows how to implement conditional retries with increasing delays based on specific HTTP status codes. Useful for handling transient API failures. |
| [force_out_of_memory.py](https://github.com/PrefectHQ/examples/blob/main/flows/force_out_of_memory.py) | Demonstrates how to reproduce and diagnose memory issues in flows. |
| [local_concurrency_with_async.py](https://github.com/PrefectHQ/examples/blob/main/flows/local_concurrency_with_async.py) | Implements concurrent API requests using Python's native async capabilities. |
| [local_concurrency_with_task_runner.py](https://github.com/PrefectHQ/examples/blob/main/flows/local_concurrency_with_task_runner.py) | Shows how to achieve concurrency using Prefect's ThreadPoolTaskRunner. |
| [return_custom_state.py](https://github.com/PrefectHQ/examples/blob/main/flows/return_custom_state.py) | Demonstrates returning custom states from tasks, specifically for implementing retry logic. |
| [schedule_specific_parameters.py](https://github.com/PrefectHQ/examples/blob/main/flows/schedule_specific_parameters.py) | Shows how to bind specific parameters to a schedule. |
| [update_flow_run_state_from_hook.py](https://github.com/PrefectHQ/examples/blob/main/flows/update_flow_run_state_from_hook.py) | Shows how to update flow run states using hooks and the Prefect client. |
| [update_flow_run_state_via_client.py](https://github.com/PrefectHQ/examples/blob/main/flows/update_flow_run_state_via_client.py) | Shows how to update flow run states using hooks and the Prefect client. |
| [update_flow_run_tags.py](https://github.com/PrefectHQ/examples/blob/main/flows/update_flow_run_tags.py) | Demonstrates updating flow run tags during execution. |
| [whoami.py](https://github.com/PrefectHQ/examples/blob/main/flows/whoami.py) | A diagnostic flow that logs information about the current execution environment. |
15 changes: 15 additions & 0 deletions docs/v3/examples/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,19 @@ git clone https://github.com/PrefectHQ/examples.git
cd examples
```

Run an example:

<CodeGroup>

```bash uv
uv run flows/hello_world.py
```

```bash pip
# Remember to `pip install` any dependencies first
python flows/hello_world.py
```

</CodeGroup>

See the [flows](/v3/examples/flows), [deployments](/v3/examples/deployments), [infrastructure](/v3/examples/infrastructure), and [scripts](/v3/examples/scripts) pages for a brief description of the examples included in the repository.
2 changes: 1 addition & 1 deletion docs/v3/examples/scripts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ These examples are sourced from the [PrefectHQ/examples](https://github.com/Pref
| [create_automation.py](https://github.com/PrefectHQ/examples/blob/main/scripts/create_automation.py) | Creates a Prefect automation that sends email notifications when flow runs fail or crash. Demonstrates block and automation creation via the API. |
| [cross_workspace_flow_runs.py](https://github.com/PrefectHQ/examples/blob/main/scripts/cross_workspace_flow_runs.py) | Lists flow run counts by state and date across all workspaces in an account. Useful for analyzing flow run patterns and workspace usage. |
| [extract_with_dlt.py](https://github.com/PrefectHQ/examples/blob/main/scripts/extract_with_dlt.py) | Shows how to extract Prefect Cloud data (deployments, flows, flow runs) using the dlt (data load tool) library into a DuckDB database. |
| [list_block_versions.py](https://github.com/PrefectHQ/examples/blob/main/scripts/list_block_versions.py) | Displays a table of all block types in a workspace with their versions, creation dates, and checksums. Helpful for auditing block versions. |
| [list_block_type_versions.py](https://github.com/PrefectHQ/examples/blob/main/scripts/list_block_type_versions.py) | Displays a table of all block types in a workspace with their versions, creation dates, and checksums. Helpful for auditing block versions. |
| [update_deployment_concurrency_limit.py](https://github.com/PrefectHQ/examples/blob/main/scripts/update_deployment_concurrency_limit.py) | Updates a deployment's concurrency limits via the API. Useful when working with Prefect 2.x installations where direct model updates aren't supported. |

0 comments on commit 1cf5ee6

Please sign in to comment.