Hi, Dagster family! I tried searching for a simple...
# ask-community
n
Hi, Dagster family! I tried searching for a simple answer in the docs and on slack but couldn't find what I wanted- hoping one of you kind souls can point me the right way... I want to run some ops in sequence (they are dependent on each other), they need to pass a dictionary of values to each other. Additional twist: the ops need to come from an op factory! Example of what I'm looking to do:
🤖 1
s
HI Nicholas - here's a slightly-pared-down version of your example that should work:
Copy code
from dagster import op, job


def compliance1(order: int, CID=""):
    @op(
        tags={"dagster/priority": str(order * -1)},
        name="Compliance1_MRP" + "_" + CID,
    )
    def my_inner_op():
        return {"CID": CID, "cvars": ...}

    return my_inner_op


def compliance2(order: int, CID=""):
    @op(
        tags={"dagster/priority": str(order * -1)},
        name="Compliance2_MRP" + "_" + CID,
    )
    def my_inner_op(dictionary):
        return ...

    return my_inner_op


@job(
    name="Compliance_Test",
    config={
        "execution": {
            "config": {
                "multiprocess": {
                    "max_concurrent": 1,
                },
            }
        }
    },
)
def Compliance_Test():
    companies = ["a", "b"]
    for i in range(len(companies)):
        compliance1_op = compliance1(order=i, CID=companies[i])
        compliance2_op = compliance2(order=i, CID=companies[i])
        compliance2_op(compliance1_op())
❤️ 1
n
very nice! ty