Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/api/flow-decorators/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class MyFlow(FlowSpec):
## Index

- [`@conda_base`](/api/flow-decorators/conda_base) - set libraries used by all steps.
- [`@package_sources`](/api/flow-decorators/package_sources) - include additional local
source roots in the code package.
- [`@project`](/api/flow-decorators/project) - create isolated namespaces around flows.
- [`@schedule`](/api/flow-decorators/schedule) - define when to run flows in production.
- [`@trigger`](/api/flow-decorators/trigger) - trigger a deployed flow when an event occurs.
Expand Down
106 changes: 106 additions & 0 deletions docs/api/flow-decorators/package_sources.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "package-sources-introduction",
"metadata": {},
"source": [
"# @package_sources\n",
"\n",
"The `@package_sources` decorator includes local files or directories that live outside a flow file's directory in its code package. It is useful for sibling packages shared by multiple flows and conventional `src` project layouts.\n",
"\n",
"For a complete example, see [Structuring Projects](/scaling/project-structure)."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "package-sources-import",
"metadata": {
"execution": {
"iopub.execute_input": "2026-08-27T22:28:01.471841Z",
"iopub.status.busy": "2026-08-27T22:28:01.471672Z",
"iopub.status.idle": "2026-08-27T22:28:03.806449Z",
"shell.execute_reply": "2026-08-27T22:28:03.805994Z"
}
},
"outputs": [],
"source": [
"#meta:tag=hide\n",
"from functools import partial\n",
"from nbdoc.showdoc import ShowDoc\n",
"ShowDoc = partial(ShowDoc, module_nm='metaflow')\n",
"\n",
"from metaflow import package_sources"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "package-sources-reference",
"metadata": {
"execution": {
"iopub.execute_input": "2026-08-27T22:28:03.808893Z",
"iopub.status.busy": "2026-08-27T22:28:03.808641Z",
"iopub.status.idle": "2026-08-27T22:28:03.816691Z",
"shell.execute_reply": "2026-08-27T22:28:03.816306Z"
}
},
"outputs": [
{
"data": {
"text/html": [
"<HTMLRemove>\n",
"<h3> <code>class</code> <span style=\"color:Brown\">package_sources</span> <em>(*args, **kwargs)</em><a href=\"https://github.com/Netflix/metaflow/tree/master/metaflow/plugins/package_sources.py#L12\" style=\"float:right\">[source]</a></h3><strong>metaflow</strong><p><blockquote>Include&nbsp;additional&nbsp;files&nbsp;or&nbsp;directories&nbsp;in&nbsp;a&nbsp;flow's&nbsp;code&nbsp;package.<br><br>Relative&nbsp;source&nbsp;paths&nbsp;are&nbsp;resolved&nbsp;from&nbsp;the&nbsp;directory&nbsp;containing&nbsp;the&nbsp;flow<br>file,&nbsp;not&nbsp;from&nbsp;the&nbsp;current&nbsp;working&nbsp;directory.&nbsp;By&nbsp;default,&nbsp;each&nbsp;source&nbsp;is<br>placed&nbsp;in&nbsp;the&nbsp;code&nbsp;package&nbsp;under&nbsp;its&nbsp;basename.<br><br>Parameters<br>----------<br>sources&nbsp;:&nbsp;path-like,&nbsp;(path-like,&nbsp;path-like),&nbsp;or&nbsp;iterable&nbsp;of&nbsp;these<br>&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;source&nbsp;file&nbsp;or&nbsp;directory,&nbsp;a&nbsp;``(source,&nbsp;arcname)``&nbsp;pair,&nbsp;or&nbsp;multiple<br>&nbsp;&nbsp;&nbsp;&nbsp;source&nbsp;specifications.&nbsp;Directories&nbsp;are&nbsp;traversed&nbsp;recursively.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;source&nbsp;may&nbsp;be&nbsp;absolute&nbsp;or&nbsp;relative&nbsp;to&nbsp;the&nbsp;flow&nbsp;file.&nbsp;The&nbsp;optional<br>&nbsp;&nbsp;&nbsp;&nbsp;``arcname``&nbsp;in&nbsp;a&nbsp;pair&nbsp;specifies&nbsp;where&nbsp;that&nbsp;source&nbsp;is&nbsp;placed&nbsp;inside&nbsp;the<br>&nbsp;&nbsp;&nbsp;&nbsp;code&nbsp;package.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;Use&nbsp;a&nbsp;list&nbsp;to&nbsp;specify&nbsp;exactly&nbsp;two&nbsp;sources&nbsp;without&nbsp;archive&nbsp;names;<br>&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;two-item&nbsp;tuple&nbsp;is&nbsp;interpreted&nbsp;as&nbsp;``(source,&nbsp;arcname)``.<br>arcname&nbsp;:&nbsp;path-like,&nbsp;optional<br>&nbsp;&nbsp;&nbsp;&nbsp;Destination&nbsp;for&nbsp;a&nbsp;single&nbsp;source&nbsp;inside&nbsp;the&nbsp;code&nbsp;package.&nbsp;It&nbsp;must&nbsp;be&nbsp;a<br>&nbsp;&nbsp;&nbsp;&nbsp;safe&nbsp;relative&nbsp;path&nbsp;and&nbsp;cannot&nbsp;be&nbsp;absolute,&nbsp;``.``,&nbsp;or&nbsp;contain&nbsp;``..``.<br>&nbsp;&nbsp;&nbsp;&nbsp;For&nbsp;multiple&nbsp;sources,&nbsp;specify&nbsp;archive&nbsp;paths&nbsp;with&nbsp;``(source,&nbsp;arcname)``<br>&nbsp;&nbsp;&nbsp;&nbsp;pairs&nbsp;instead.<br>suffixes&nbsp;:&nbsp;iterable&nbsp;of&nbsp;str&nbsp;or&nbsp;comma-separated&nbsp;str,&nbsp;optional<br>&nbsp;&nbsp;&nbsp;&nbsp;File&nbsp;suffixes&nbsp;to&nbsp;include.&nbsp;Leading&nbsp;dots&nbsp;are&nbsp;optional&nbsp;and&nbsp;matching&nbsp;is<br>&nbsp;&nbsp;&nbsp;&nbsp;case-insensitive.&nbsp;The&nbsp;default&nbsp;is&nbsp;``DEFAULT_PACKAGE_SUFFIXES``<br>&nbsp;&nbsp;&nbsp;&nbsp;(``.py,.R,.RDS``&nbsp;by&nbsp;default).<br><br>&nbsp;&nbsp;&nbsp;&nbsp;Providing&nbsp;this&nbsp;argument&nbsp;replaces&nbsp;the&nbsp;default&nbsp;suffix&nbsp;set;&nbsp;it&nbsp;does&nbsp;not<br>&nbsp;&nbsp;&nbsp;&nbsp;extend&nbsp;it.<br><br>Raises<br>------<br>MetaflowException<br>&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;a&nbsp;source&nbsp;does&nbsp;not&nbsp;exist,&nbsp;an&nbsp;archive&nbsp;path&nbsp;is&nbsp;unsafe,&nbsp;or&nbsp;``arcname``<br>&nbsp;&nbsp;&nbsp;&nbsp;is&nbsp;used&nbsp;with&nbsp;multiple&nbsp;sources.<br><br>Examples<br>--------<br>Given&nbsp;this&nbsp;project&nbsp;layout::<br><br>&nbsp;&nbsp;&nbsp;&nbsp;project/<br>&nbsp;&nbsp;&nbsp;&nbsp;├──&nbsp;flows/<br>&nbsp;&nbsp;&nbsp;&nbsp;│&nbsp;&nbsp;&nbsp;└──&nbsp;train.py<br>&nbsp;&nbsp;&nbsp;&nbsp;└──&nbsp;src/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└──&nbsp;forecasting/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└──&nbsp;__init__.py<br><br>Package&nbsp;``forecasting``&nbsp;at&nbsp;the&nbsp;archive&nbsp;root&nbsp;so&nbsp;it&nbsp;remains&nbsp;importable&nbsp;as<br>``import&nbsp;forecasting``&nbsp;during&nbsp;remote&nbsp;execution::<br><br>&nbsp;&nbsp;&nbsp;&nbsp;from&nbsp;metaflow&nbsp;import&nbsp;FlowSpec,&nbsp;package_sources<br><br>&nbsp;&nbsp;&nbsp;&nbsp;@package_sources(\"../src/forecasting\")<br>&nbsp;&nbsp;&nbsp;&nbsp;class&nbsp;TrainFlow(FlowSpec):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...<br><br>Package&nbsp;multiple&nbsp;sources,&nbsp;assigning&nbsp;a&nbsp;custom&nbsp;archive&nbsp;location&nbsp;to&nbsp;one&nbsp;of<br>them&nbsp;and&nbsp;including&nbsp;JSON&nbsp;files::<br><br>&nbsp;&nbsp;&nbsp;&nbsp;@package_sources(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"../shared\",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(\"../generated/client\",&nbsp;\"vendor/client\"),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;],<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;suffixes=[\".py\",&nbsp;\".json\"],<br>&nbsp;&nbsp;&nbsp;&nbsp;)<br>&nbsp;&nbsp;&nbsp;&nbsp;class&nbsp;TrainFlow(FlowSpec):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...</blockquote></p>\n",
"</HTMLRemove>\n",
"<DocSection type=\"class\" name=\"package_sources\" module=\"metaflow\" show_import=\"True\" heading_level=\"3\" link=\"https://github.com/Netflix/metaflow/tree/master/metaflow/plugins/package_sources.py#L12\">\n",
"<SigArgSection>\n",
"<SigArg name=\"*args\" /><SigArg name=\"**kwargs\" />\n",
"</SigArgSection>\n",
"<Description summary=\"Include additional files or directories in a flow's code package.\" extended_summary=\"Relative source paths are resolved from the directory containing the flow\\nfile, not from the current working directory. By default, each source is\\nplaced in the code package under its basename.\" />\n",
"<ParamSection name=\"Parameters\">\n",
"\t<Parameter name=\"sources\" type=\"path-like, (path-like, path-like), or iterable of these\" desc=\"A source file or directory, a ``(source, arcname)`` pair, or multiple\\nsource specifications. Directories are traversed recursively.\\n\\nA source may be absolute or relative to the flow file. The optional\\n``arcname`` in a pair specifies where that source is placed inside the\\ncode package.\\n\\nUse a list to specify exactly two sources without archive names;\\na two-item tuple is interpreted as ``(source, arcname)``.\" />\n",
"\t<Parameter name=\"arcname\" type=\"path-like, optional\" desc=\"Destination for a single source inside the code package. It must be a\\nsafe relative path and cannot be absolute, ``.``, or contain ``..``.\\nFor multiple sources, specify archive paths with ``(source, arcname)``\\npairs instead.\" />\n",
"\t<Parameter name=\"suffixes\" type=\"iterable of str or comma-separated str, optional\" desc=\"File suffixes to include. Leading dots are optional and matching is\\ncase-insensitive. The default is ``DEFAULT_PACKAGE_SUFFIXES``\\n(``.py,.R,.RDS`` by default).\\n\\nProviding this argument replaces the default suffix set; it does not\\nextend it.\" />\n",
"</ParamSection>\n",
"<ParamSection name=\"Raises\">\n",
"\t<Parameter type=\"MetaflowException\" desc=\"If a source does not exist, an archive path is unsafe, or ``arcname``\\nis used with multiple sources.\" />\n",
"</ParamSection>\n",
"</DocSection>"
],
"text/plain": [
"<nbdoc.showdoc.ShowDoc at 0x79c0c06bb410>"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ShowDoc(package_sources, skip_sections='Attributes', show_import=True)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.15"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
23 changes: 23 additions & 0 deletions docs/api/flow-decorators/package_sources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# @package_sources

The `@package_sources` decorator includes local files or directories that live outside a flow file's directory in its code package. It is useful for sibling packages shared by multiple flows and conventional `src` project layouts.

For a complete example, see [Structuring Projects](/scaling/project-structure).

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! Instead, edit the notebook w/the location & name as this file. -->


<DocSection type="class" name="package_sources" module="metaflow" show_import="True" heading_level="3" link="https://github.com/Netflix/metaflow/tree/master/metaflow/plugins/package_sources.py#L12">
<SigArgSection>
<SigArg name="*args" /><SigArg name="**kwargs" />
</SigArgSection>
<Description summary="Include additional files or directories in a flow's code package." extended_summary="Relative source paths are resolved from the directory containing the flow\nfile, not from the current working directory. By default, each source is\nplaced in the code package under its basename." />
<ParamSection name="Parameters">
<Parameter name="sources" type="path-like, (path-like, path-like), or iterable of these" desc="A source file or directory, a ``(source, arcname)`` pair, or multiple\nsource specifications. Directories are traversed recursively.\n\nA source may be absolute or relative to the flow file. The optional\n``arcname`` in a pair specifies where that source is placed inside the\ncode package.\n\nUse a list to specify exactly two sources without archive names;\na two-item tuple is interpreted as ``(source, arcname)``." />
<Parameter name="arcname" type="path-like, optional" desc="Destination for a single source inside the code package. It must be a\nsafe relative path and cannot be absolute, ``.``, or contain ``..``.\nFor multiple sources, specify archive paths with ``(source, arcname)``\npairs instead." />
<Parameter name="suffixes" type="iterable of str or comma-separated str, optional" desc="File suffixes to include. Leading dots are optional and matching is\ncase-insensitive. The default is ``DEFAULT_PACKAGE_SUFFIXES``\n(``.py,.R,.RDS`` by default).\n\nProviding this argument replaces the default suffix set; it does not\nextend it." />
</ParamSection>
<ParamSection name="Raises">
<Parameter type="MetaflowException" desc="If a source does not exist, an archive path is unsafe, or ``arcname``\nis used with multiple sources." />
</ParamSection>
</DocSection>
31 changes: 17 additions & 14 deletions docs/api/step-decorators/step.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"id": "627487a4",
"metadata": {
"execution": {
"iopub.execute_input": "2025-08-30T21:15:38.147424Z",
"iopub.status.busy": "2025-08-30T21:15:38.147351Z",
"iopub.status.idle": "2025-08-30T21:15:38.392184Z",
"shell.execute_reply": "2025-08-30T21:15:38.391902Z"
"iopub.execute_input": "2026-08-27T22:28:08.779038Z",
"iopub.status.busy": "2026-08-27T22:28:08.778830Z",
"iopub.status.idle": "2026-08-27T22:28:11.540137Z",
"shell.execute_reply": "2026-08-27T22:28:11.539695Z"
}
},
"outputs": [],
Expand All @@ -40,34 +40,37 @@
"id": "af50a6d2",
"metadata": {
"execution": {
"iopub.execute_input": "2025-08-30T21:15:38.394428Z",
"iopub.status.busy": "2025-08-30T21:15:38.394270Z",
"iopub.status.idle": "2025-08-30T21:15:38.398172Z",
"shell.execute_reply": "2025-08-30T21:15:38.397923Z"
"iopub.execute_input": "2026-08-27T22:28:11.542526Z",
"iopub.status.busy": "2026-08-27T22:28:11.542272Z",
"iopub.status.idle": "2026-08-27T22:28:11.548115Z",
"shell.execute_reply": "2026-08-27T22:28:11.547814Z"
}
},
"outputs": [
{
"data": {
"text/html": [
"<HTMLRemove>\n",
"<h3> <code>function</code> <span style=\"color:Brown\">step</span> <em></em><a href=\"https://github.com/Netflix/metaflow/tree/master/metaflow/decorators.py#L821\" style=\"float:right\">[source]</a></h3><strong>metaflow</strong><p><blockquote>Marks&nbsp;a&nbsp;method&nbsp;in&nbsp;a&nbsp;FlowSpec&nbsp;as&nbsp;a&nbsp;Metaflow&nbsp;Step.&nbsp;Note&nbsp;that&nbsp;this<br>decorator&nbsp;needs&nbsp;to&nbsp;be&nbsp;placed&nbsp;as&nbsp;close&nbsp;to&nbsp;the&nbsp;method&nbsp;as&nbsp;possible&nbsp;(ie:<br>before&nbsp;other&nbsp;decorators).<br><br>In&nbsp;other&nbsp;words,&nbsp;this&nbsp;is&nbsp;valid:<br>```<br>@batch<br>@step<br>def&nbsp;foo(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;pass<br>```<br><br>whereas&nbsp;this&nbsp;is&nbsp;not:<br>```<br>@step<br>@batch<br>def&nbsp;foo(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;pass<br>```<br><br>Parameters<br>----------<br>f&nbsp;:&nbsp;Union[Callable[[FlowSpecDerived],&nbsp;None],&nbsp;Callable[[FlowSpecDerived,&nbsp;Any],&nbsp;None]]<br>&nbsp;&nbsp;&nbsp;&nbsp;Function&nbsp;to&nbsp;make&nbsp;into&nbsp;a&nbsp;Metaflow&nbsp;Step<br><br>Returns<br>-------<br>Union[Callable[[FlowSpecDerived,&nbsp;StepFlag],&nbsp;None],&nbsp;Callable[[FlowSpecDerived,&nbsp;Any,&nbsp;StepFlag],&nbsp;None]]<br>&nbsp;&nbsp;&nbsp;&nbsp;Function&nbsp;that&nbsp;is&nbsp;a&nbsp;Metaflow&nbsp;Step</blockquote></p>\n",
"<h3> <code>function</code> <span style=\"color:Brown\">step</span> <em></em><a href=\"https://github.com/Netflix/metaflow/tree/master/metaflow/decorators.py#L1121\" style=\"float:right\">[source]</a></h3><strong>metaflow</strong><p><blockquote>Marks&nbsp;a&nbsp;method&nbsp;in&nbsp;a&nbsp;FlowSpec&nbsp;as&nbsp;a&nbsp;Metaflow&nbsp;Step.&nbsp;Note&nbsp;that&nbsp;this<br>decorator&nbsp;needs&nbsp;to&nbsp;be&nbsp;placed&nbsp;as&nbsp;close&nbsp;to&nbsp;the&nbsp;method&nbsp;as&nbsp;possible&nbsp;(ie:<br>before&nbsp;other&nbsp;decorators).<br><br>In&nbsp;other&nbsp;words,&nbsp;this&nbsp;is&nbsp;valid:<br>```<br>@batch<br>@step<br>def&nbsp;foo(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;pass<br>```<br><br>whereas&nbsp;this&nbsp;is&nbsp;not:<br>```<br>@step<br>@batch<br>def&nbsp;foo(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;pass<br>```<br><br>Parameters<br>----------<br>f&nbsp;:&nbsp;callable,&nbsp;optional<br>&nbsp;&nbsp;&nbsp;&nbsp;Function&nbsp;to&nbsp;make&nbsp;into&nbsp;a&nbsp;Metaflow&nbsp;Step.&nbsp;When&nbsp;using&nbsp;keyword&nbsp;arguments<br>&nbsp;&nbsp;&nbsp;&nbsp;(e.g.&nbsp;``@step(start=True)``),&nbsp;this&nbsp;is&nbsp;``None``&nbsp;and&nbsp;a&nbsp;decorator<br>&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;is&nbsp;returned&nbsp;instead.<br>start&nbsp;:&nbsp;bool,&nbsp;default&nbsp;False<br>&nbsp;&nbsp;&nbsp;&nbsp;Mark&nbsp;this&nbsp;step&nbsp;as&nbsp;the&nbsp;start&nbsp;(entry)&nbsp;step&nbsp;of&nbsp;the&nbsp;flow.<br>end&nbsp;:&nbsp;bool,&nbsp;default&nbsp;False<br>&nbsp;&nbsp;&nbsp;&nbsp;Mark&nbsp;this&nbsp;step&nbsp;as&nbsp;the&nbsp;end&nbsp;(terminal)&nbsp;step&nbsp;of&nbsp;the&nbsp;flow.<br>node_info&nbsp;:&nbsp;dict,&nbsp;optional<br>&nbsp;&nbsp;&nbsp;&nbsp;Extra&nbsp;metadata&nbsp;to&nbsp;attach&nbsp;to&nbsp;this&nbsp;step's&nbsp;DAGNode.&nbsp;Extensions&nbsp;can&nbsp;use<br>&nbsp;&nbsp;&nbsp;&nbsp;this&nbsp;to&nbsp;store&nbsp;arbitrary&nbsp;information&nbsp;accessible&nbsp;via&nbsp;``flow._graph``<br>&nbsp;&nbsp;&nbsp;&nbsp;(live&nbsp;references)&nbsp;and&nbsp;``_graph_info``&nbsp;(serialized&nbsp;via&nbsp;``to_pod``).<br><br>Returns<br>-------<br>callable<br>&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;decorated&nbsp;function,&nbsp;or&nbsp;a&nbsp;decorator&nbsp;if&nbsp;keyword&nbsp;arguments&nbsp;were&nbsp;used.</blockquote></p>\n",
"</HTMLRemove>\n",
"<DocSection type=\"function\" name=\"step\" module=\"metaflow\" show_import=\"True\" heading_level=\"3\" link=\"https://github.com/Netflix/metaflow/tree/master/metaflow/decorators.py#L821\">\n",
"<DocSection type=\"function\" name=\"step\" module=\"metaflow\" show_import=\"True\" heading_level=\"3\" link=\"https://github.com/Netflix/metaflow/tree/master/metaflow/decorators.py#L1121\">\n",
"<SigArgSection>\n",
"<SigArg name=\"\" />\n",
"</SigArgSection>\n",
"<Description summary=\"Marks a method in a FlowSpec as a Metaflow Step. Note that this\\ndecorator needs to be placed as close to the method as possible (ie:\\nbefore other decorators).\" extended_summary=\"In other words, this is valid:\\n```\\n@batch\\n@step\\ndef foo(self):\\n pass\\n```\\n\\nwhereas this is not:\\n```\\n@step\\n@batch\\ndef foo(self):\\n pass\\n```\" />\n",
"<ParamSection name=\"Parameters\">\n",
"\t<Parameter name=\"f\" type=\"Union[Callable[[FlowSpecDerived], None], Callable[[FlowSpecDerived, Any], None]]\" desc=\"Function to make into a Metaflow Step\" />\n",
"\t<Parameter name=\"f\" type=\"callable, optional\" desc=\"Function to make into a Metaflow Step. When using keyword arguments\\n(e.g. ``@step(start=True)``), this is ``None`` and a decorator\\nfunction is returned instead.\" />\n",
"\t<Parameter name=\"start\" type=\"bool, default False\" desc=\"Mark this step as the start (entry) step of the flow.\" />\n",
"\t<Parameter name=\"end\" type=\"bool, default False\" desc=\"Mark this step as the end (terminal) step of the flow.\" />\n",
"\t<Parameter name=\"node_info\" type=\"dict, optional\" desc=\"Extra metadata to attach to this step's DAGNode. Extensions can use\\nthis to store arbitrary information accessible via ``flow._graph``\\n(live references) and ``_graph_info`` (serialized via ``to_pod``).\" />\n",
"</ParamSection>\n",
"<ParamSection name=\"Returns\">\n",
"\t<Parameter type=\"Union[Callable[[FlowSpecDerived, StepFlag], None], Callable[[FlowSpecDerived, Any, StepFlag], None]]\" desc=\"Function that is a Metaflow Step\" />\n",
"\t<Parameter type=\"callable\" desc=\"The decorated function, or a decorator if keyword arguments were used.\" />\n",
"</ParamSection>\n",
"</DocSection>"
],
"text/plain": [
"<nbdoc.showdoc.ShowDoc at 0x11171de10>"
"<nbdoc.showdoc.ShowDoc at 0x76148decb910>"
]
},
"execution_count": 2,
Expand Down Expand Up @@ -104,7 +107,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.11.15"
}
},
"nbformat": 4,
Expand Down
Loading
Loading