Loading...
Loading...
Compare original and translation side by side
docs/AGENTS.mddocs/AGENTS.mdv3/get-started/v3/get-started/<Steps><Tabs><Steps><Tabs>v3/concepts/v3/concepts/v3/how-to-guides/v3/how-to-guides/workflows/deployments/prefect.yamldeployment_infra/automations/cloud/configuration/ai/migrate/self-hosted/workflows/deployments/prefect.yamldeployment_infra/automations/cloud/configuration/ai/migrate/self-hosted/v3/advanced/v3/advanced/v3/examples/v3/examples/examples/generate_example_pages.py.pyexamples/just generate-examplescontribute/docs-contribute.mdxexamples/generate_example_pages.pyexamples/.pyjust generate-examplescontribute/docs-contribute.mdxintegrations/integrations/prefect-awsprefect-gcpindex.mdxintegrations/catalog/prefect-awsprefect-gcpindex.mdxintegrations/catalog/v3/api-ref/v3/api-ref/python/cli/rest-api/<ResponseField><Accordion>python/cli/rest-api/<ResponseField><Accordion>v3/release-notes/v3/release-notes/oss/cloud/integrations/oss/cloud/integrations/contribute/contribute/deployment_infra/navigation.tabsdocs/docs.jsonindex.mdxdeployment_infra/docs/docs.jsonnavigation.tabsindex.mdxtemplate-howto.mdxtemplate-concept.mdxtemplate-howto.mdxtemplate-concept.mdxkeywordskeywords: ["retry", "retries", "error handling", "fault tolerance"]titledescriptionkeywordskeywords: ["retry", "retries", "error handling", "fault tolerance"]titledescriptiondocs/docs.jsonnavigation.tabs.mdx{
"tab": "How-to Guides",
"pages": [
"v3/how-to-guides/index",
{
"group": "Workflows",
"pages": [
"v3/how-to-guides/workflows/write-and-run",
"v3/how-to-guides/workflows/retries"
]
}
]
}"tab""pages""groups""pages"{"group": ..., "pages": [...]}docs/docs.jsonnavigation.tabs.mdx{
"tab": "How-to Guides",
"pages": [
"v3/how-to-guides/index",
{
"group": "Workflows",
"pages": [
"v3/how-to-guides/workflows/write-and-run",
"v3/how-to-guides/workflows/retries"
]
}
]
}"tab""pages""groups""pages"{"group": ..., "pages": [...]}<Note>Important information.</Note>
<Warning>Caution about potential issues.</Warning>
<Tip>Helpful suggestion.</Tip>
<Info>Additional context.</Info>
<Accordion title="Expandable section">
Content hidden until clicked.
</Accordion>
<Tabs>
<Tab title="Option A">Content for A</Tab>
<Tab title="Option B">Content for B</Tab>
</Tabs>
<Steps>
<Step title="First step">Instructions</Step>
<Step title="Second step">Instructions</Step>
</Steps>
<CardGroup cols={3}>
<Card title="Title" icon="icon" href="/v3/path">
Description text.
</Card>
</CardGroup>
<CodeGroup>
```bash pip
pip install prefectuv pip install prefect<Note>重要信息。</Note>
<Warning>关于潜在问题的注意事项。</Warning>
<Tip>有用的建议。</Tip>
<Info>额外背景信息。</Info>
<Accordion title="可展开区块">
点击后才会显示的内容。
</Accordion>
<Tabs>
<Tab title="选项A">选项A的内容</Tab>
<Tab title="选项B">选项B的内容</Tab>
</Tabs>
<Steps>
<Step title="第一步">操作说明</Step>
<Step title="第二步">操作说明</Step>
</Steps>
<CardGroup cols={3}>
<Card title="标题" icon="icon" href="/v3/path">
描述文本。
</Card>
</CardGroup>
<CodeGroup>
```bash pip
pip install prefectuv pip install prefectsnippets/import ComponentName from '/snippets/path.mdx'
<ComponentName />snippets/installation.mdxv3/get-started/install.mdxsnippets/resource-management/snippets/import ComponentName from '/snippets/path.mdx'
<ComponentName />snippets/installation.mdxv3/get-started/install.mdxsnippets/resource-management/```python my_flow.py
from prefect import flow
@flow
def hello():
print("Hello!")
```
```bash {3} [expandable]
prefect deploy --all
prefect work-pool create my-pool --type process
prefect worker start --pool my-pool
```{/* pmd-metadata: notest */}foobarprocess_ordercustomer_id```python my_flow.py
from prefect import flow
@flow
def hello():
print("Hello!")
```
```bash {3} [expandable]
prefect deploy --all
prefect work-pool create my-pool --type process
prefect worker start --pool my-pool
```{/* pmd-metadata: notest */}foobarprocess_ordercustomer_id.mdxdocs/conftest.py.mdxdocs/conftest.py.mdxcontinuation.mdxcontinuationjustundefinedjustundefinedundefinedundefined{/* pmd-metadata: <directive> */}notest{/* pmd-metadata: notest */}
```python{/* pmd-metadata: <directive> */}notest{/* pmd-metadata: notest */}
```pythonundefinedcontinuation```python
from prefect import flow
@flow
def my_workflow() -> str:
return "Hello, world!"my_workflow() # Can reference the function defined above
**`fixture:<name>`** — Inject a pytest fixture defined in `conftest.py` as a global in the code block. Use when a block needs mocking (e.g., HTTP calls).
```mdx
{/* pmd-metadata: fixture:mock_post_200 */}
```python
import requests
response = requests.post(endpoint, headers=headers, json=data)
assert response.status_code == 200undefinedundefinedcontinuation```python
from prefect import flow
@flow
def my_workflow() -> str:
return "Hello, world!"my_workflow() # 可以引用上面定义的函数
**`fixture:<name>`** — 将 `conftest.py` 中定义的pytest fixture作为全局变量注入到代码块中。当代码块需要mock(例如HTTP调用)时使用。
```mdx
{/* pmd-metadata: fixture:mock_post_200 */}
```python
import requests
response = requests.post(endpoint, headers=headers, json=data)
assert response.status_code == 200undefinedpytest_markdown_docs_globalsconftest.pyMappedRunUnionmapped_columnsaconftest.pypytest_markdown_docs_globalsMappedRunUnionmapped_columnsaconftest.pymock_runner_startprefect.cli.flow.Runner.startmock_base_worker_submitBaseWorker.submitKubernetesWorker.submitconftest.pymock_runner_startprefect.cli.flow.Runner.startmock_base_worker_submitBaseWorker.submitKubernetesWorker.submitSKIP_FILESconftest.pyv3/api-ref/python/v3/examples/SKIP_FILESnotestconftest.pySKIP_FILESv3/api-ref/python/v3/examples/SKIP_FILESnotestv3/img/v3/img/ui/v3/img/concepts/v3/img/v3/img/ui/v3/img/concepts/just lintvale --glob='**/*.{md,mdx}' .just lintvale --glob='**/*.{md,mdx}' .| Instead of | Write |
|---|---|
| "We recommend configuring..." | "Configure..." |
| "You'll want to make sure to..." | "Make sure to..." or just state the instruction |
| "This powerful feature allows you to..." | "Use [feature] to..." |
| "I'll show you how to set up..." | "To set up..., do the following:" |
| "It should be noted that..." | State the fact directly |
| "In order to" | "To" |
| 避免使用 | 推荐使用 |
|---|---|
| "我们建议配置..." | "配置..." |
| "你需要确保..." | "请确保..." 或者直接给出指令 |
| "这个强大的特性可以让你..." | "使用[特性]来..." |
| "我会教你如何设置..." | "要设置...,请执行以下操作:" |
| "需要注意的是..." | 直接陈述事实 |
| "为了" | "要" |
{/* pmd-metadata: notest */}keywordsdocs/docs.json{/* pmd-metadata: notest */}keywordsdocs/docs.json#title.mdx> **Note:**<Note>descriptionkeywordsdocs/docs.jsondocs/docs.json<Note><Tip><Warning>#title.mdx> **Note:**<Note>descriptionkeywordsdocs/docs.jsondocs/docs.json<Note><Tip><Warning>