Skip to content

Commit

Permalink
Update unreleased documentation (#575)
Browse files Browse the repository at this point in the history
* Update versions.json

* Deployed a0f8ad2 to unreleased in versions with MkDocs 1.5.3 and mike 2.0.0

* Sort docs versions

---------

Co-authored-by: GitHub Actions Bot <[email protected]>
  • Loading branch information
github-actions[bot] and GitHub Actions Bot authored Jan 20, 2024
1 parent b661976 commit a30c73e
Show file tree
Hide file tree
Showing 5 changed files with 313 additions and 285 deletions.
125 changes: 72 additions & 53 deletions versions/unreleased/api-ref/prefect/flows/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14665,6 +14665,35 @@ <h2 id="prefect.flows.flow" class="doc doc-heading">
<code>None</code>
</td>
</tr>
<tr>
<td><code>retries</code></td>
<td>
<code>int</code>
</td>
<td>
<div class="doc-md-description">
<p>An optional number of times to retry on flow run failure.</p>
</div>
</td>
<td>
<code>None</code>
</td>
</tr>
<tr>
<td><code>retry_delay_seconds</code></td>
<td>
<code><span title="typing.Union">Union</span>[int, float]</code>
</td>
<td>
<div class="doc-md-description">
<p>An optional number of seconds to wait before retrying the
flow after failure. This is only applicable if <code>retries</code> is nonzero.</p>
</div>
</td>
<td>
<code>None</code>
</td>
</tr>
<tr>
<td><code>task_runner</code></td>
<td>
Expand Down Expand Up @@ -14730,35 +14759,6 @@ <h2 id="prefect.flows.flow" class="doc doc-heading">
<code>True</code>
</td>
</tr>
<tr>
<td><code>retries</code></td>
<td>
<code>int</code>
</td>
<td>
<div class="doc-md-description">
<p>An optional number of times to retry on flow run failure.</p>
</div>
</td>
<td>
<code>None</code>
</td>
</tr>
<tr>
<td><code>retry_delay_seconds</code></td>
<td>
<code><span title="typing.Union">Union</span>[int, float]</code>
</td>
<td>
<div class="doc-md-description">
<p>An optional number of seconds to wait before retrying the
flow after failure. This is only applicable if <code>retries</code> is nonzero.</p>
</div>
</td>
<td>
<code>None</code>
</td>
</tr>
<tr>
<td><code>persist_result</code></td>
<td>
Expand Down Expand Up @@ -14811,6 +14811,21 @@ <h2 id="prefect.flows.flow" class="doc doc-heading">
<code>None</code>
</td>
</tr>
<tr>
<td><code>cache_result_in_memory</code></td>
<td>
<code>bool</code>
</td>
<td>
<div class="doc-md-description">
<p>An optional toggle indicating whether the cached result of
a running the flow should be stored in memory. Defaults to <code>True</code>.</p>
</div>
</td>
<td>
<code>True</code>
</td>
</tr>
<tr>
<td><code>log_prints</code></td>
<td>
Expand Down Expand Up @@ -15132,7 +15147,9 @@ <h2 id="prefect.flows.flow" class="doc doc-heading">
<span class="normal">1425</span>
<span class="normal">1426</span>
<span class="normal">1427</span>
<span class="normal">1428</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">flow</span><span class="p">(</span>
<span class="normal">1428</span>
<span class="normal">1429</span>
<span class="normal">1430</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">flow</span><span class="p">(</span>
<span class="n">__fn</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="o">*</span><span class="p">,</span>
<span class="n">name</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
Expand Down Expand Up @@ -15172,6 +15189,9 @@ <h2 id="prefect.flows.flow" class="doc doc-heading">
<span class="sd"> flow_run_name: An optional name to distinguish runs of this flow; this name can</span>
<span class="sd"> be provided as a string template with the flow&#39;s parameters as variables,</span>
<span class="sd"> or a function that returns a string.</span>
<span class="sd"> retries: An optional number of times to retry on flow run failure.</span>
<span class="sd"> retry_delay_seconds: An optional number of seconds to wait before retrying the</span>
<span class="sd"> flow after failure. This is only applicable if `retries` is nonzero.</span>
<span class="sd"> task_runner: An optional task runner to use for task execution within the flow; if</span>
<span class="sd"> not provided, a `ConcurrentTaskRunner` will be instantiated.</span>
<span class="sd"> description: An optional string description for the flow; if not provided, the</span>
Expand All @@ -15185,9 +15205,6 @@ <h2 id="prefect.flows.flow" class="doc doc-heading">
<span class="sd"> type; for example, if a parameter is defined as `x: int` and &quot;5&quot; is passed,</span>
<span class="sd"> it will be resolved to `5`. If set to `False`, no validation will be</span>
<span class="sd"> performed on flow parameters.</span>
<span class="sd"> retries: An optional number of times to retry on flow run failure.</span>
<span class="sd"> retry_delay_seconds: An optional number of seconds to wait before retrying the</span>
<span class="sd"> flow after failure. This is only applicable if `retries` is nonzero.</span>
<span class="sd"> persist_result: An optional toggle indicating whether the result of this flow</span>
<span class="sd"> should be persisted to result storage. Defaults to `None`, which indicates</span>
<span class="sd"> that Prefect should choose whether the result should be persisted depending on</span>
Expand All @@ -15201,6 +15218,8 @@ <h2 id="prefect.flows.flow" class="doc doc-heading">
<span class="sd"> in this flow. If not provided, the value of `PREFECT_RESULTS_DEFAULT_SERIALIZER`</span>
<span class="sd"> will be used unless called as a subflow, at which point the default will be</span>
<span class="sd"> loaded from the parent flow.</span>
<span class="sd"> cache_result_in_memory: An optional toggle indicating whether the cached result of</span>
<span class="sd"> a running the flow should be stored in memory. Defaults to `True`.</span>
<span class="sd"> log_prints: If set, `print` statements in the flow will be redirected to the</span>
<span class="sd"> Prefect logger for the flow run. Defaults to `None`, which indicates that</span>
<span class="sd"> the value from the parent flow should be used. If this is a parent flow,</span>
Expand Down Expand Up @@ -15416,9 +15435,7 @@ <h2 id="prefect.flows.load_flow_from_entrypoint" class="doc doc-heading">

<details class="quote">
<summary>Source code in <code>prefect/flows.py</code></summary>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1520</span>
<span class="normal">1521</span>
<span class="normal">1522</span>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1522</span>
<span class="normal">1523</span>
<span class="normal">1524</span>
<span class="normal">1525</span>
Expand Down Expand Up @@ -15449,7 +15466,9 @@ <h2 id="prefect.flows.load_flow_from_entrypoint" class="doc doc-heading">
<span class="normal">1550</span>
<span class="normal">1551</span>
<span class="normal">1552</span>
<span class="normal">1553</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">load_flow_from_entrypoint</span><span class="p">(</span><span class="n">entrypoint</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Flow</span><span class="p">:</span>
<span class="normal">1553</span>
<span class="normal">1554</span>
<span class="normal">1555</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">load_flow_from_entrypoint</span><span class="p">(</span><span class="n">entrypoint</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Flow</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Extract a flow object from a script at an entrypoint by running all of the code in the file.</span>

Expand Down Expand Up @@ -15630,9 +15649,7 @@ <h2 id="prefect.flows.load_flow_from_script" class="doc doc-heading">

<details class="quote">
<summary>Source code in <code>prefect/flows.py</code></summary>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1493</span>
<span class="normal">1494</span>
<span class="normal">1495</span>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1495</span>
<span class="normal">1496</span>
<span class="normal">1497</span>
<span class="normal">1498</span>
Expand All @@ -15654,7 +15671,9 @@ <h2 id="prefect.flows.load_flow_from_script" class="doc doc-heading">
<span class="normal">1514</span>
<span class="normal">1515</span>
<span class="normal">1516</span>
<span class="normal">1517</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">load_flow_from_script</span><span class="p">(</span><span class="n">path</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">flow_name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Flow</span><span class="p">:</span>
<span class="normal">1517</span>
<span class="normal">1518</span>
<span class="normal">1519</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">load_flow_from_script</span><span class="p">(</span><span class="n">path</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">flow_name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Flow</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Extract a flow object from a script by running all of the code in the file.</span>

Expand Down Expand Up @@ -15704,9 +15723,7 @@ <h2 id="prefect.flows.load_flow_from_text" class="doc doc-heading">

<details class="quote">
<summary>Source code in <code>prefect/flows.py</code></summary>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1556</span>
<span class="normal">1557</span>
<span class="normal">1558</span>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1558</span>
<span class="normal">1559</span>
<span class="normal">1560</span>
<span class="normal">1561</span>
Expand All @@ -15725,7 +15742,9 @@ <h2 id="prefect.flows.load_flow_from_text" class="doc doc-heading">
<span class="normal">1574</span>
<span class="normal">1575</span>
<span class="normal">1576</span>
<span class="normal">1577</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">load_flow_from_text</span><span class="p">(</span><span class="n">script_contents</span><span class="p">:</span> <span class="n">AnyStr</span><span class="p">,</span> <span class="n">flow_name</span><span class="p">:</span> <span class="nb">str</span><span class="p">):</span>
<span class="normal">1577</span>
<span class="normal">1578</span>
<span class="normal">1579</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">load_flow_from_text</span><span class="p">(</span><span class="n">script_contents</span><span class="p">:</span> <span class="n">AnyStr</span><span class="p">,</span> <span class="n">flow_name</span><span class="p">:</span> <span class="nb">str</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Load a flow from a text script.</span>

Expand Down Expand Up @@ -15819,9 +15838,7 @@ <h2 id="prefect.flows.load_flows_from_script" class="doc doc-heading">

<details class="quote">
<summary>Source code in <code>prefect/flows.py</code></summary>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1479</span>
<span class="normal">1480</span>
<span class="normal">1481</span>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1481</span>
<span class="normal">1482</span>
<span class="normal">1483</span>
<span class="normal">1484</span>
Expand All @@ -15830,7 +15847,9 @@ <h2 id="prefect.flows.load_flows_from_script" class="doc doc-heading">
<span class="normal">1487</span>
<span class="normal">1488</span>
<span class="normal">1489</span>
<span class="normal">1490</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">load_flows_from_script</span><span class="p">(</span><span class="n">path</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">List</span><span class="p">[</span><span class="n">Flow</span><span class="p">]:</span>
<span class="normal">1490</span>
<span class="normal">1491</span>
<span class="normal">1492</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">load_flows_from_script</span><span class="p">(</span><span class="n">path</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">List</span><span class="p">[</span><span class="n">Flow</span><span class="p">]:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Load all flow objects from the given python script. All of the code in the file</span>
<span class="sd"> will be executed.</span>
Expand Down Expand Up @@ -15911,9 +15930,7 @@ <h2 id="prefect.flows.select_flow" class="doc doc-heading">

<details class="quote">
<summary>Source code in <code>prefect/flows.py</code></summary>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1435</span>
<span class="normal">1436</span>
<span class="normal">1437</span>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1437</span>
<span class="normal">1438</span>
<span class="normal">1439</span>
<span class="normal">1440</span>
Expand Down Expand Up @@ -15952,7 +15969,9 @@ <h2 id="prefect.flows.select_flow" class="doc doc-heading">
<span class="normal">1473</span>
<span class="normal">1474</span>
<span class="normal">1475</span>
<span class="normal">1476</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">select_flow</span><span class="p">(</span>
<span class="normal">1476</span>
<span class="normal">1477</span>
<span class="normal">1478</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">def</span> <span class="nf">select_flow</span><span class="p">(</span>
<span class="n">flows</span><span class="p">:</span> <span class="n">Iterable</span><span class="p">[</span><span class="n">Flow</span><span class="p">],</span> <span class="n">flow_name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="n">from_message</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="kc">None</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Flow</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
Expand Down
13 changes: 11 additions & 2 deletions versions/unreleased/concepts/flows/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10067,13 +10067,22 @@ <h2 id="retrieve-a-flow-from-remote-storage">Retrieve a flow from remote storage
<div class="highlight"><span class="filename">load_from_url.py</span><pre><span></span><code><span class="kn">from</span> <span class="nn">prefect</span> <span class="kn">import</span> <span class="n">flow</span>

<span class="n">my_flow</span> <span class="o">=</span> <span class="n">flow</span><span class="o">.</span><span class="n">from_source</span><span class="p">(</span>
<span class="n">source</span><span class="o">=</span><span class="s2">&quot;https://github.com/org/repo.git&quot;</span><span class="p">,</span>
<span class="n">entrypoint</span><span class="o">=</span><span class="s2">&quot;flows.py:my_flow&quot;</span>
<span class="n">source</span><span class="o">=</span><span class="s2">&quot;https://github.com/PrefectHQ/prefect.git&quot;</span><span class="p">,</span>
<span class="n">entrypoint</span><span class="o">=</span><span class="s2">&quot;flows/hello_world.py:hello&quot;</span>
<span class="p">)</span>

<span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s2">&quot;__main__&quot;</span><span class="p">:</span>
<span class="n">my_flow</span><span class="p">()</span>
</code></pre></div>
<div class="terminal">

<div class="highlight"><pre><span></span><code><span class="m">16</span>:40:33.818<span class="w"> </span><span class="p">|</span><span class="w"> </span>INFO<span class="w"> </span><span class="p">|</span><span class="w"> </span>prefect.engine<span class="w"> </span>-<span class="w"> </span>Created<span class="w"> </span>flow<span class="w"> </span>run<span class="w"> </span><span class="s1">&#39;muscular-perch&#39;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span>flow<span class="w"> </span><span class="s1">&#39;hello&#39;</span>
<span class="m">16</span>:40:34.048<span class="w"> </span><span class="p">|</span><span class="w"> </span>INFO<span class="w"> </span><span class="p">|</span><span class="w"> </span>Flow<span class="w"> </span>run<span class="w"> </span><span class="s1">&#39;muscular-perch&#39;</span><span class="w"> </span>-<span class="w"> </span>Hello<span class="w"> </span>world!
<span class="m">16</span>:40:34.706<span class="w"> </span><span class="p">|</span><span class="w"> </span>INFO<span class="w"> </span><span class="p">|</span><span class="w"> </span>Flow<span class="w"> </span>run<span class="w"> </span><span class="s1">&#39;muscular-perch&#39;</span><span class="w"> </span>-<span class="w"> </span>Finished<span class="w"> </span><span class="k">in</span><span class="w"> </span>state<span class="w"> </span>Completed<span class="o">()</span>
</code></pre></div>

</div>

<p>A flow entrypoint is the path to the file the flow is located in and the name of the flow function separated by a colon.</p>
<p>If you need additional configuration, such as specifying a private repository, you can provide a <a href="/api-ref/prefect/flows/#prefect.runner.storage.GitRepository"><code>GitRepository</code></a> instead of URL:</p>
<div class="highlight"><span class="filename">load_from_storage.py</span><pre><span></span><code><span class="kn">from</span> <span class="nn">prefect</span> <span class="kn">import</span> <span class="n">flow</span>
Expand Down
2 changes: 1 addition & 1 deletion versions/unreleased/search/search_index.json

Large diffs are not rendered by default.

Loading

0 comments on commit a30c73e

Please sign in to comment.