JobSelector parameter example
# ask-ai
a
JobSelector parameter example
s
The documentation provides an example of how to use the
op_selection
parameter when executing a job in process. Here's the example from the documentation:
Copy code
python my_job.execute_in_process(op_selection=["*add_two"])
In this example,
op_selection
is used to specify which ops to execute within the job. The string
"*add_two"
selects the op named
add_two
and all of its ancestors (upstream dependencies). Please note that the
op_selection
parameter is used to control which parts of a job to run, and the syntax used in the selection string determines the scope of the execution. Here are some patterns you can use, as described in the documentation: - `some_op`: Selects
some_op
itself. - `*some_op`: Selects
some_op
and all ancestors (upstream dependencies). - `some_op*`: Selects
some_op
and all descendants (downstream dependencies). - `*some_op*`: Selects
some_op
and all of its ancestors and descendants. - `+some_op`: Selects
some_op
and its direct parents. - `some_op+++`: Selects
some_op
and its children, its children's children, and its children's children's children. This selection syntax can be used in the
op_selection
argument when executing a job in process, as shown in the example above, or it can be specified in the Dagster UI Launchpad when launching a job.