Does anyone know how to use python assertion state...
# dagster-feedback
f
Does anyone know how to use python assertion statements with dagster return variables? Just trying to validate a sql query before I push dbt to run it using dagster
Copy code
@job
def my_pipeline():
    e = checkETL.check_sql_query()
    #assert e == True
    #run dbt Model

if __name__ == "__main__":
    result = my_pipeline.execute_in_process()
    # assert result.output_value ==True
a
IMO you should put validation logic in an op - something like
Copy code
@job
def my_pipeline():
    dbt_model_op(check_sql_query())

@op
def check_sql_query():
    e = checkETL.check_sql_query()
    return e
so now
dbt_model_op
can check that the ETL (or any input) is validated and end the run (fail gracefully) if not
f
I do have a validation check within the code. Just need to know the return value when the job is moving from op to op