# ask-ai

David Takacs

03/12/2024, 3:28 PM
@Scout what is an op?


03/12/2024, 3:28 PM
An op in Dagster is the functional unit of user-defined computation. It represents a single logical step within a data pipeline or workflow. An op performs a specific task, such as transforming data, running a calculation, or interacting with an external system. Ops can be combined to form a graph, which is a collection of ops connected together to create a data pipeline. Ops are defined using the
decorator in Python, and they can have inputs and outputs that define the data they receive and produce. Ops are the building blocks for more complicated jobs and assets in Dagster. While ops are available and can be used to construct pipelines, the framework emphasizes assets as the main abstraction to build upon. Assets represent the data produced by ops and provide a higher-level abstraction for managing data dependencies and lineage. Here's a simple example of an op from the documentation:
Copy code
python @op def hello_world():     print('hello')
This op, when executed, would simply print "hello" to the console. Ops can also take inputs and return outputs, allowing them to be chained together in a graph to perform more complex computations.