Skip to content

Commit

Permalink
[docs] dynamic graphs
Browse files Browse the repository at this point in the history
Summary: add api docs entries

Test Plan: trying to preview locally but cant run

Reviewers: yuhan, sashank, dgibson

Reviewed By: dgibson

Differential Revision: https://dagster.phacility.com/D6003
  • Loading branch information
alangenfeld committed Jan 14, 2021
1 parent 3952737 commit 2fe99ab
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
sections/api/apidocs/repositories
sections/api/apidocs/schedules
sections/api/apidocs/solids
sections/api/apidocs/dynamic
sections/api/apidocs/types
sections/api/apidocs/utilities
sections/api/apidocs/libraries/dagster_airflow
Expand Down
3 changes: 3 additions & 0 deletions docs/next/src/pages/_apidocs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ APIs from the core `dagster` package, divided roughly by topic:
- [IO Managers](/_apidocs/io-managers)
APIs to define how inputs and outputs are handled and loaded.

- [Dynamic Graphs (Experimental)](/_apidocs/dynamic)
APIs that allow graph structures to be determined at run time.

- [Utilities](/_apidocs/utilities)
Miscellaneous helpers used by Dagster that may be useful to users.

Expand Down
4 changes: 4 additions & 0 deletions docs/next/src/treeOfContents.json
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,10 @@
"name": "IO Managers",
"path": "/_apidocs/io-managers"
},
{
"name": "Dynamic Graphs (Experimental)",
"path": "/_apidocs/dynamic"
},
{
"name": "Utilities",
"path": "/_apidocs/utilities"
Expand Down
8 changes: 8 additions & 0 deletions docs/sections/api/apidocs/dynamic.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Dynamic Graphs (Experimental)
=============================

.. currentmodule:: dagster.experimental

.. autoclass:: DynamicOutputDefinition

.. autoclass:: DynamicOutput
6 changes: 3 additions & 3 deletions python_modules/dagster/dagster/core/definitions/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,9 @@ def __new__(cls, value, output_name=DEFAULT_OUTPUT):

class DynamicOutput(namedtuple("_DynamicOutput", "value mapping_key output_name")):
"""
Variant of :py:class:`Output` used to support mapping. Each DynamicOutput produced by a solid
will result in the downstream dag being cloned to run on that individual value. Each DynamicOutput
must have a unique mapping_key to distinguish it.
(Experimental) Variant of :py:class:`Output` used to support mapping. Each DynamicOutput
produced by a solid will result in the downstream dag being cloned to run on that individual
value. Each DynamicOutput must have a unique mapping_key to distinguish it.
Args:
value (Any):
Expand Down
6 changes: 6 additions & 0 deletions python_modules/dagster/dagster/core/definitions/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ def mapping_from(self, solid_name, output_name=None):


class DynamicOutputDefinition(OutputDefinition):
"""
(EXPERIMENTAL) Variant of :py:class:`OutputDefinition` for an output that will dynamically
alter the graph at runtime. Each copy of :py:class:`DynamicOutput` corresponding to this
definition that is yielded from the solid will create a copy of the downstream graph.
"""

@property
def is_dynamic(self):
return True
Expand Down

0 comments on commit 2fe99ab

Please sign in to comment.