Changeset View
Changeset View
Standalone View
Standalone View
docs/content/concepts/solids-pipelines/solids.mdx
Show First 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | |||||
A solid only starts to execute once all of its inputs have been resolved. Inputs can be resolved in two ways: | A solid only starts to execute once all of its inputs have been resolved. Inputs can be resolved in two ways: | ||||
- The upstream output that the input depends on has been successfully emitted and stored. | - The upstream output that the input depends on has been successfully emitted and stored. | ||||
- The input was stubbed through config. | - The input was stubbed through config. | ||||
You can use a [Dagster Type](/concepts/types) to provide a function that validates a solid's input every time the solid runs. In this case, you use <PyObject object="InputDefinition" pluralize /> corresponding to the decorated function arguments. | You can use a [Dagster Type](/concepts/types) to provide a function that validates a solid's input every time the solid runs. In this case, you use <PyObject object="InputDefinition" pluralize /> corresponding to the decorated function arguments. | ||||
```python file=/concepts/solids_pipelines/solids.py startafter=start_typed_input_solid_marker endbefore=end_typed_input_solid_marker | ```python file=/concepts/solids_pipelines/solids.py startafter=start_typed_input_solid_marker endbefore=end_typed_input_solid_marker | ||||
MyDagsterType = DagsterType(type_check_fn=lambda _, value: value % 2 == 0, name="MyDagsterType") | MyDagsterType = DagsterType( | ||||
type_check_fn=lambda _, value: value % 2 == 0, name="MyDagsterType" | |||||
) | |||||
@solid(input_defs=[InputDefinition(name="abc", dagster_type=MyDagsterType)]) | @solid(input_defs=[InputDefinition(name="abc", dagster_type=MyDagsterType)]) | ||||
def my_typed_input_solid(abc): | def my_typed_input_solid(abc): | ||||
pass | pass | ||||
``` | ``` | ||||
#### Outputs | #### Outputs | ||||
▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | Args: | ||||
args (any): One or more arguments used to generate the nwe solid | args (any): One or more arguments used to generate the nwe solid | ||||
name (str): The name of the new solid. | name (str): The name of the new solid. | ||||
input_defs (list[InputDefinition]): Any input definitions for the new solid. Default: None. | input_defs (list[InputDefinition]): Any input definitions for the new solid. Default: None. | ||||
Returns: | Returns: | ||||
function: The new solid. | function: The new solid. | ||||
""" | """ | ||||
@solid(name=name, input_defs=input_defs or [InputDefinition("start", Nothing)], **kwargs) | @solid( | ||||
name=name, | |||||
input_defs=input_defs or [InputDefinition("start", Nothing)], | |||||
**kwargs, | |||||
) | |||||
def _x_solid(context): | def _x_solid(context): | ||||
# Solid logic here | # Solid logic here | ||||
pass | pass | ||||
return _x_solid | return _x_solid | ||||
``` | ``` | ||||
## FAQ | ## FAQ | ||||
### Why "Solid"? | ### Why "Solid"? | ||||
Why is a solid called a "solid"? It is a journey from a novel concept, to a familiar acronym, and back to a word. | Why is a solid called a "solid"? It is a journey from a novel concept, to a familiar acronym, and back to a word. | ||||
In a data management system, there are two broad categories of data: source data––meaning the data directly inputted by a user, gathered from an uncontrolled external system, or generated directly by a device––and computed data––data produced by computation over other data. Management of computed data is the primary concern of Dagster. Another name for computed data would be software-structured data. Or SSD. Given that SSD is already a well-known acronym for Solid State Drives we named our core concept for software-structured data a Solid. | In a data management system, there are two broad categories of data: source data––meaning the data directly inputted by a user, gathered from an uncontrolled external system, or generated directly by a device––and computed data––data produced by computation over other data. Management of computed data is the primary concern of Dagster. Another name for computed data would be software-structured data. Or SSD. Given that SSD is already a well-known acronym for Solid State Drives we named our core concept for software-structured data a Solid. |