Hi all, (I know we should be using ops and jobs no...
# ask-community
b
Hi all, (I know we should be using ops and jobs now, not solids & pipelines, but I’m just picking up a massive codebase that I definitely did not write and trying to make a few small changes before I go refactoring things…) So - the issue is that I need to unpack a tuple from one solid (pre_flight_validate) in the context of another (notify_slack_of_successful_ingress_validation) - something like this - but clearly this is wrong - any hints?
Copy code
def pre_flight_validate(context: AbstractComputeExecutionContext) -> Any:
    """
    Runs the external validation code on the provided staging area.
    """
    staging_area = context.solid_config["staging_area"]
    total_retries = context.solid_config["total_retries"]
    gcs_client: Client = context.resources.gcs
    validator: HcaValidator = context.resources.staging_area_validator

    exit_code = validator.validate_staging_area(
        path=staging_area, retries=total_retries, ignore_inputs=True, client=gcs_client
    )
    if exit_code:
        raise Failure(f"Staging area {staging_area} is invalid")

    # return staging_area, total_retries
    yield Output(staging_area, output_name="staging_area")
    yield Output(total_retries, output_name="total_retries")
Copy code
@solid(required_resource_keys={"slack", "pre_flight_validate"})
def notify_slack_of_successful_ingress_validation(
    # context: AbstractComputeExecutionContext, staging_area: str
    context: AbstractComputeExecutionContext, pre_flight_validate()[0]: str
) -> str:
    message_lines = [
        f"{staging_area} has passed pre-validation.",
    ]
    message = "\n".join(message_lines)

    context.resources.slack.send_message(message)

    return message
a
this might be helpful: https://docs.dagster.io/concepts/ops-jobs-graphs/dynamic-graphs#multiple-outputs your composing function (@pipeline/@job/@graph) has to take care of passing the right out put from op to op / solid to solid