https://dagster.io/ logo
#ask-ai
Title
# ask-ai
a

Andreas

03/07/2024, 6:45 AM
what is an op
s

Scout

03/07/2024, 6:45 AM
An op in Dagster is the functional unit of user-defined computation. It represents a single computational step within a data pipeline. Each op is a Python function that is decorated with the
@op
decorator, indicating that it is intended to be used as part of a Dagster job. Here's a brief overview of the characteristics of an op: - Name: Each op must have a unique name within any
GraphDefinition
or
JobDefinition
that contains it. - Inputs: Ops can have inputs, which are defined by
input_defs
. These inputs are the data that the op will process. - Compute Function: The core of the op is the compute function, which performs the actual computation. The signature of this function is determined by the
input_defs
, and it may optionally include an injected first argument,
context
, which provides system-provided information. - Outputs: Ops can produce outputs, defined by
output_defs
. The compute function must yield one
Output
for each of the op’s outputs. It may also yield other types of Dagster events, such as
AssetMaterialization
and
ExpectationResult
. Ops are the building blocks of Dagster jobs and graphs, allowing developers to define the logic of their data processing and orchestration in a modular and reusable manner. For more details on what an op is and how to use it, you can refer to the documentation on the Dagster website.